Class CompressExtension
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.websocket.common.extensions.AbstractExtension
org.eclipse.jetty.websocket.common.extensions.compress.CompressExtension
- All Implemented Interfaces:
org.eclipse.jetty.util.component.LifeCycle, Extension, IncomingFrames, OutgoingFrames
- Direct Known Subclasses:
DeflateFrameExtension, PerMessageDeflateExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicIntegerprotected static final intInflater / Decompressed Buffer Sizeprotected static final intDeflater / Inflater: Maximum Input Buffer Sizeprotected static final intAlways set RSV flag, on all frame typesprotected static final intOnly set RSV flag on first frame in multi-frame messages.protected static final byte[]protected static final ByteBufferprotected static final intAlways drop tail bytes 0000FFFF, from all frame typesprotected static final intOnly drop tail bytes 0000FFFF, from fin==true framesprotected static final intNever drop tail bytes 0000FFFF, from any frame typeFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecompress(ByteAccumulator accumulator, ByteBuffer buf) protected voiddoStop()static booleanendsWithTail(ByteBuffer buf) protected voidforwardIncoming(Frame frame, ByteAccumulator accumulator) booleanIndicates use of RSV1 flag for indicating deflation is in use.protected ByteAccumulatorprotected voidnotifyCallbackFailure(WriteCallback callback, Throwable failure) protected voidnotifyCallbackSuccess(WriteCallback callback) voidoutgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode) A frame, and optional callback, intended for the network layer.voidsetDeflaterPool(org.eclipse.jetty.util.compression.DeflaterPool deflaterPool) voidsetInflaterPool(org.eclipse.jetty.util.compression.InflaterPool inflaterPool) toString()Methods inherited from class AbstractExtension
getBufferPool, getConfig, getConnection, getName, getNextIncoming, getNextOutgoing, getPolicy, init, init, isRsv2User, isRsv3User, nextIncomingFrame, nextOutgoingFrame, setBufferPool, setConfig, setConnection, setNextIncomingFrames, setNextOutgoingFrames, setPolicyMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, doStart, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IncomingFrames
incomingFrame
-
Field Details
-
TAIL_BYTES
protected static final byte[] TAIL_BYTES -
TAIL_BYTES_BUF
-
TAIL_DROP_NEVER
protected static final int TAIL_DROP_NEVERNever drop tail bytes 0000FFFF, from any frame type- See Also:
-
TAIL_DROP_ALWAYS
protected static final int TAIL_DROP_ALWAYSAlways drop tail bytes 0000FFFF, from all frame types- See Also:
-
TAIL_DROP_FIN_ONLY
protected static final int TAIL_DROP_FIN_ONLYOnly drop tail bytes 0000FFFF, from fin==true frames- See Also:
-
RSV_USE_ALWAYS
protected static final int RSV_USE_ALWAYSAlways set RSV flag, on all frame types- See Also:
-
RSV_USE_ONLY_FIRST
protected static final int RSV_USE_ONLY_FIRSTOnly set RSV flag on first frame in multi-frame messages.Note: this automatically means no-continuation frames have the RSV bit set
- See Also:
-
INFLATE_BUFFER_SIZE
protected static final int INFLATE_BUFFER_SIZEInflater / Decompressed Buffer Size- See Also:
-
INPUT_MAX_BUFFER_SIZE
protected static final int INPUT_MAX_BUFFER_SIZEDeflater / Inflater: Maximum Input Buffer Size- See Also:
-
decompressCount
-
-
Constructor Details
-
CompressExtension
protected CompressExtension()
-
-
Method Details
-
setInflaterPool
public void setInflaterPool(org.eclipse.jetty.util.compression.InflaterPool inflaterPool) -
setDeflaterPool
public void setDeflaterPool(org.eclipse.jetty.util.compression.DeflaterPool deflaterPool) -
getDeflater
-
getInflater
-
isRsv1User
public boolean isRsv1User()Indicates use of RSV1 flag for indicating deflation is in use.- Specified by:
isRsv1Userin interfaceExtension- Overrides:
isRsv1Userin classAbstractExtension- Returns:
- true if extension uses RSV1 for its own purposes.
-
forwardIncoming
-
newByteAccumulator
-
decompress
- Throws:
DataFormatException
-
outgoingFrame
Description copied from interface:OutgoingFramesA 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 WriteCallback appropriately.
- Parameters:
frame- the frame to eventually write to the network layer.callback- the callback to notify when the frame is written.batchMode- the batch mode requested by the sender.
-
notifyCallbackSuccess
-
notifyCallbackFailure
-
endsWithTail
-
doStop
-
toString
- Overrides:
toStringin classAbstractExtension
-