Attempts to follow Compression Extensions for WebSocket
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private ExtensionConfig | |
| private ExtensionConfig | |
| private static final int | |
| private int | |
| private CompressionPool | |
| private boolean | |
| private boolean | |
| private final PerMessageDeflateExtension. | |
| private int | |
| private CompressionPool | |
| private static final Logger | |
| private boolean | |
| private final PerMessageDeflateExtension. | |
| private static final byte[] | |
| private static final ByteBuffer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides default org. Used to clean up any resources after connection close. |
| public void | |
| public static boolean | |
| public Deflater | |
| public Inflater | |
| public String | getName()
Overrides org. Implements org. The |
| public void | init(final ExtensionConfig config, WebSocketComponents components)
Overrides org. Implements org.
|
| public boolean | isRsv1User()
Overrides org. Implements org. Used to indicate that the extension makes use of the RSV1 bit of the base websocket framing. |
| protected void | nextIncomingFrame(Frame frame, Callback callback)
Overrides org.
|
| protected void | nextOutgoingFrame(Frame frame, Callback callback, boolean batch)
Overrides org.
|
| public void | onFrame(Frame
the frame to process. frame, Callback the read completion. callback)Overrides org. Implements org. Process the incoming frame. |
| public void | |
| public void | |
| public void | sendFrame(Frame
the frame to eventually write to the network layer. frame, Callback the callback to notify when the frame is written. callback, boolean the batch mode requested by the sender. batch)Overrides org. Implements org. A frame, and optional callback, intended for the network layer. |
| public void | setNextDemand(DemandChain nextDemand)
Overrides default org.
|
| private static String | |
| private static String | |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| configNegotiated | back to summary |
|---|---|
| private ExtensionConfig configNegotiated | |
| configRequested | back to summary |
|---|---|
| private ExtensionConfig configRequested | |
| DEFAULT_BUF_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_BUF_SIZE | |
| deflateBufferSize | back to summary |
|---|---|
| private int deflateBufferSize | |
| deflaterHolder | back to summary |
|---|---|
| private CompressionPool<Deflater>. | |
| incomingCompressed | back to summary |
|---|---|
| private boolean incomingCompressed | |
| incomingContextTakeover | back to summary |
|---|---|
| private boolean incomingContextTakeover | |
| incomingFlusher | back to summary |
|---|---|
| private final PerMessageDeflateExtension. | |
| inflateBufferSize | back to summary |
|---|---|
| private int inflateBufferSize | |
| inflaterHolder | back to summary |
|---|---|
| private CompressionPool<Inflater>. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| outgoingContextTakeover | back to summary |
|---|---|
| private boolean outgoingContextTakeover | |
| outgoingFlusher | back to summary |
|---|---|
| private final PerMessageDeflateExtension. | |
| TAIL_BYTES | back to summary |
|---|---|
| private static final byte[] TAIL_BYTES | |
| TAIL_BYTES_BUF | back to summary |
|---|---|
| private static final ByteBuffer TAIL_BYTES_BUF | |
| PerMessageDeflateExtension | back to summary |
|---|---|
| public PerMessageDeflateExtension() | |
| close | back to summary |
|---|---|
| public void close() Overrides default org. Doc from org. Used to clean up any resources after connection close.
| |
| demand | back to summary |
|---|---|
| public void demand() Implements org.
| |
| endsWithTail | back to summary |
|---|---|
| public static boolean endsWithTail(ByteBuffer buf) | |
| getDeflater | back to summary |
|---|---|
| public Deflater getDeflater() | |
| getInflater | back to summary |
|---|---|
| public Inflater getInflater() | |
| getName | back to summary |
|---|---|
| public String getName() Overrides org. Implements org. Doc from org. The
Also known as the | |
| init | back to summary |
|---|---|
| public void init(final ExtensionConfig config, WebSocketComponents components) Overrides org. Implements org.
| |
| isRsv1User | back to summary |
|---|---|
| public boolean isRsv1User() Overrides org. Implements org. Doc from org. Used to indicate that the extension makes use of the RSV1 bit of the base websocket framing. This is used to adjust validation during parsing, as well as a checkpoint against 2 or more extensions all simultaneously claiming ownership of RSV1.
| |
| nextIncomingFrame | back to summary |
|---|---|
| protected void nextIncomingFrame(Frame frame, Callback callback) Overrides org.
| |
| nextOutgoingFrame | back to summary |
|---|---|
| protected void nextOutgoingFrame(Frame frame, Callback callback, boolean batch) Overrides org.
| |
| onFrame | back to summary |
|---|---|
| public void onFrame(Frame frame, Callback callback) Overrides org. Implements org. Doc from org. Process the incoming frame. Note if you need to hang onto any information from the frame, be sure to copy it, as the information contained in the Frame will be released and/or reused by the implementation. Failure of the callback will propagate the failure back to the | |
| releaseDeflater | back to summary |
|---|---|
| public void releaseDeflater() | |
| releaseInflater | back to summary |
|---|---|
| public void releaseInflater() | |
| sendFrame | back to summary |
|---|---|
| public void sendFrame(Frame frame, Callback callback, boolean batch) Overrides org. Implements org. Doc from org. A frame, and optional callback, intended for the network layer. Note the frame can undergo many transformations in the various layers and extensions present in the implementation. If you are implementing a mutation, you are obliged to handle the incoming Callback appropriately. | |
| setNextDemand | back to summary |
|---|---|
| public void setNextDemand(DemandChain nextDemand) Overrides default org.
| |
| toDetail | back to summary |
|---|---|
| private static String toDetail(Inflater inflater) | |
| toDetail | back to summary |
|---|---|
| private static String toDetail(Deflater deflater) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private AtomicReference | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | handle(Frame
the original frame. frame, Callback to succeed to release the frame payload. callback, boolean if this is the first time this method has been called for this frame. first)Implements abstract org. Called when there is demand for a single frame to be produced. |
| private boolean | |
| protected void | onCompleteFailure(Throwable
the throwable to indicate cause of failure cause)Overrides org. Invoked when the overall task has completed with a failure. |
| private void |
| _payloadRef | back to summary |
|---|---|
| private AtomicReference<RetainableByteBuffer> _payloadRef | |
| _tailBytes | back to summary |
|---|---|
| private boolean _tailBytes | |
| IncomingFlusher | back to summary |
|---|---|
| public IncomingFlusher() | |
| handle | back to summary |
|---|---|
| protected boolean handle(Frame frame, Callback callback, boolean first) Implements abstract org. Doc from org. Called when there is demand for a single frame to be produced. During this method a single call can be made
to Note that the callback supplied here is specially wrapped so that you can call it multiple times and it will not be completed more than once. This simplifies the handling of failure cases.
| |
| inflate | back to summary |
|---|---|
| private boolean inflate(Frame frame, Callback callback, boolean first) throws DataFormatException | |
| onCompleteFailure | back to summary |
|---|---|
| protected void onCompleteFailure(Throwable cause) Overrides org. Doc from org. Invoked when the overall task has completed with a failure. | |
| releasePayload | back to summary |
|---|---|
| private void releasePayload(AtomicReference<RetainableByteBuffer> reference) | |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| private Frame |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| protected boolean | onFrame(Frame
the frame to transform. frame, Callback used to signal to start processing again. callback, boolean whether this frame can be batched. batch)Implements abstract org. Called when a frame is ready to be transformed. |
| protected boolean | transform(Callback
used to signal to start processing again. callback)Implements abstract org. Called to transform the frame given in |
| _batch | back to summary |
|---|---|
| private boolean _batch | |
| _first | back to summary |
|---|---|
| private boolean _first | |
| _frame | back to summary |
|---|---|
| private Frame _frame | |
| OutgoingFlusher | back to summary |
|---|---|
| private OutgoingFlusher() | |
| deflate | back to summary |
|---|---|
| private boolean deflate(Callback callback) | |
| onFrame | back to summary |
|---|---|
| protected boolean onFrame(Frame frame, Callback callback, boolean batch) Implements abstract org. Doc from org. Called when a frame is ready to be transformed. | |
| transform | back to summary |
|---|---|
| protected boolean transform(Callback callback) Implements abstract org. Doc from org. Called to transform the frame given in | |