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 ClassesModifier and TypeClassDescriptionprivate classprivate static classNested 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 TypeFieldDescriptionprivate static final intInflater : Output Buffer Sizeprotected AtomicIntegerprivate Deflaterprivate org.eclipse.jetty.util.compression.DeflaterPoolprivate final Queue<CompressExtension.FrameEntry> private final org.eclipse.jetty.util.IteratingCallbackprotected static final intInflater / Decompressed Buffer Sizeprivate Inflaterprivate org.eclipse.jetty.util.compression.InflaterPoolprotected static final intDeflater / Inflater: Maximum Input Buffer Sizeprivate static final org.eclipse.jetty.util.log.Loggerprotected static final intAlways set RSV flag, on all frame typesprotected static final intOnly set RSV flag on first frame in multi-frame messages.private intprotected 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 typeprivate intFields 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) (package private) abstract intReturn the mode of operation for RSV flag use in frames generate by compress (outgoing)(package private) abstract intReturn the mode of operation for dropping (or keeping) tail bytes in frames generated by compress (outgoing)booleanIndicates use of RSV1 flag for indicating deflation is in use.protected ByteAccumulatorprotected voidnotifyCallbackFailure(WriteCallback callback, Throwable failure) protected voidnotifyCallbackSuccess(WriteCallback callback) private voidvoidoutgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode) A frame, and optional callback, intended for the network layer.private CompressExtension.FrameEntryvoidsetDeflaterPool(org.eclipse.jetty.util.compression.DeflaterPool deflaterPool) voidsetInflaterPool(org.eclipse.jetty.util.compression.InflaterPool inflaterPool) private static booleansupplyInput(Deflater deflater, ByteBuffer buf) private static booleansupplyInput(Inflater inflater, ByteBuffer buf) private static Stringprivate static StringtoString()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
-
LOG
private static final org.eclipse.jetty.util.log.Logger LOG -
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:
-
DECOMPRESS_BUF_SIZE
private static final int DECOMPRESS_BUF_SIZEInflater : Output Buffer Size- See Also:
-
entries
-
flusher
private final org.eclipse.jetty.util.IteratingCallback flusher -
deflaterPool
private org.eclipse.jetty.util.compression.DeflaterPool deflaterPool -
inflaterPool
private org.eclipse.jetty.util.compression.InflaterPool inflaterPool -
deflaterImpl
-
inflaterImpl
-
decompressCount
-
tailDrop
private int tailDrop -
rsvUse
private int rsvUse
-
-
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.
-
getTailDropMode
abstract int getTailDropMode()Return the mode of operation for dropping (or keeping) tail bytes in frames generated by compress (outgoing)- Returns:
- either
TAIL_DROP_ALWAYS,TAIL_DROP_FIN_ONLY, orTAIL_DROP_NEVER
-
getRsvUseMode
abstract int getRsvUseMode()Return the mode of operation for RSV flag use in frames generate by compress (outgoing)- Returns:
- either
RSV_USE_ALWAYSorRSV_USE_ONLY_FIRST
-
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.
-
offerEntry
-
pollEntry
-
notifyCallbackSuccess
-
notifyCallbackFailure
-
supplyInput
-
supplyInput
-
toDetail
-
toDetail
-
endsWithTail
-
doStop
-
toString
- Overrides:
toStringin classAbstractExtension
-