-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WEJBHTTP-139] Final round of cleanup refactorings accross all modules #259
Open
ropalka
wants to merge
29
commits into
wildfly:main
Choose a base branch
from
ropalka:WEJBHTTP-139
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
9d631d7
[WEJBHTTP-139] Refactoring - moving static imports to the top of impo…
ropalka 682a83f
[WEJBHTTP-139] Refactoring - moving ByteOutputs classes to common module
ropalka a8be101
[WEJBHTTP-139] Refactoring - making all ByteOutputs wrapping OutputSt…
ropalka 3bfbb00
[WEJBHTTP-139] Refactoring - unify OutputStream variable names
ropalka 357e420
[WEJBHTTP-139] Removing remaining deprecated methods & constructors
ropalka 1dde42a
[WEJBHTTP-139] Refactoring - use HttpServerHelper utility method via …
ropalka 85b5810
[WEJBHTTP-139] Refactoring - merge transaction/Utils , naming/Utils &…
ropalka c4208da
[WEJBHTTP-139] Refactoring - merge common/Utils & common/HttpMarshall…
ropalka d2c8137
[WEJBHTTP-139] Refactoring - unify parameter names in Serializers
ropalka 11abf95
[WEJBHTTP-139] Refactoring - unify parameter names in ClientHandlers
ropalka 424ce0e
[WEJBHTTP-139] Refactoring - Introducing ByteInputs utility class
ropalka 4509263
[WEJBHTTP-139] Refactoring - renaming httpServiceConfig variable to c…
ropalka 1585469
[WEJBHTTP-139] Removing unused HttpRemoteEjbService.cancellationFlags…
ropalka c526cb3
[WEJBHTTP-139] Refactoring - reordering method parameters - let HttpS…
ropalka f47e24c
[WEJBHTTP-139] Refactoring - be consistent and always use HeaderMap.p…
ropalka 9b3515d
[WEJBHTTP-139] Refactoring - Use Headers fields via static imports
ropalka b1f577d
[WEJBHTTP-139] Refactoring - Use StatusCodes fields via static imports
ropalka 35e8968
[WEJBHTTP-139] Refactoring - always use HeadersHelper methods for bet…
ropalka 3a7d2b8
[WEJBHTTP-139] Refactoring - Enhance HeadersHelper methods to enhance…
ropalka 50ba294
[WEJBHTTP-139] Refactoring - use parseBoolean via static import
ropalka 928e111
[WEJBHTTP-139] Refactoring - introducing OPC query parameter constant
ropalka 0d91d27
[WEJBHTTP-139] Refactoring - use NEW_QUERY_PARAMETER constant
ropalka 1b4f665
[WEJBHTTP-139] Refactoring - unify ClientRequest variable names
ropalka b1e7ff3
[WEJBHTTP-139] Refactoring - unify ClientResponse variable names
ropalka bd13773
[WEJBHTTP-139] Refactoring - use EJB_SESSION_ID via static import
ropalka 43d0acd
[WEJBHTTP-139] Enhancement according to peer review - always throw Il…
ropalka 32c4a0e
[WEJBHTTP-139] Enhancement according to peer review - use 'input' and…
ropalka b79131a
[WEJBHTTP-139] Enhancement according to peer review - don't use Objec…
ropalka 41b44a2
[WEJBHTTP-139] Enhancement according to peer review - use txnInfo ins…
ropalka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,11 @@ | |
import java.io.OutputStream; | ||
|
||
/** | ||
* Helper class. Provides utility method for transforming OutputStreams to ByteOutputs. | ||
* Helper class. Provides various utility methods for example: | ||
* <ul> | ||
* <li>transforming OutputStreams to ByteOutputs</li> | ||
* <li>introducing special behaviour to existing byte output instances</li> | ||
* </ul> | ||
* | ||
* @author <a href="mailto:[email protected]">Richard Opalka</a> | ||
*/ | ||
|
@@ -35,7 +39,7 @@ private ByteOutputs() { | |
|
||
public static ByteOutput byteOutputOf(final OutputStream delegate) { | ||
if (delegate == null) throw new IllegalArgumentException(); | ||
return new ByteOutputStream(delegate); | ||
return new UnflushableByteOutput(new ByteOutputStream(delegate)); | ||
} | ||
|
||
private static final class ByteOutputStream implements ByteOutput { | ||
|
@@ -73,4 +77,38 @@ public void write(final byte[] b, final int off, final int len) throws IOExcepti | |
|
||
} | ||
|
||
private static final class UnflushableByteOutput implements ByteOutput { | ||
|
||
private final ByteOutput delegate; | ||
|
||
public UnflushableByteOutput(final ByteOutput delegate) { | ||
this.delegate = delegate; | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
delegate.close(); | ||
} | ||
|
||
@Override | ||
public void flush() throws IOException { | ||
//ignore | ||
} | ||
@Override | ||
public void write(final int b) throws IOException { | ||
delegate.write(b); | ||
} | ||
|
||
@Override | ||
public void write(final byte[] b) throws IOException { | ||
delegate.write(b); | ||
} | ||
|
||
@Override | ||
public void write(final byte[] b, int off, int len) throws IOException { | ||
delegate.write(b, off, len); | ||
} | ||
|
||
} | ||
|
||
} |
64 changes: 0 additions & 64 deletions
64
common/src/main/java/org/wildfly/httpclient/common/NoFlushByteOutput.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motivation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the way this protocol was implemented. Output is always sent at once to prevent fragmentation on the wire.
I maintained it for backward compatibility. For future version of the protocol we could revisit it if its really necessary.