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 class
private static class
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
Nested 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 int
Inflater : Output Buffer Sizeprotected AtomicInteger
private Deflater
private org.eclipse.jetty.util.compression.DeflaterPool
private final Queue<CompressExtension.FrameEntry>
private final org.eclipse.jetty.util.IteratingCallback
protected static final int
Inflater / Decompressed Buffer Sizeprivate Inflater
private org.eclipse.jetty.util.compression.InflaterPool
protected static final int
Deflater / Inflater: Maximum Input Buffer Sizeprivate static final org.eclipse.jetty.util.log.Logger
protected static final int
Always set RSV flag, on all frame typesprotected static final int
Only set RSV flag on first frame in multi-frame messages.private int
protected static final byte[]
protected static final ByteBuffer
protected static final int
Always drop tail bytes 0000FFFF, from all frame typesprotected static final int
Only drop tail bytes 0000FFFF, from fin==true framesprotected static final int
Never drop tail bytes 0000FFFF, from any frame typeprivate int
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
decompress
(ByteAccumulator accumulator, ByteBuffer buf) protected void
doStop()
static boolean
endsWithTail
(ByteBuffer buf) protected void
forwardIncoming
(Frame frame, ByteAccumulator accumulator) (package private) abstract int
Return the mode of operation for RSV flag use in frames generate by compress (outgoing)(package private) abstract int
Return the mode of operation for dropping (or keeping) tail bytes in frames generated by compress (outgoing)boolean
Indicates use of RSV1 flag for indicating deflation is in use.protected ByteAccumulator
protected void
notifyCallbackFailure
(WriteCallback callback, Throwable failure) protected void
notifyCallbackSuccess
(WriteCallback callback) private void
void
outgoingFrame
(Frame frame, WriteCallback callback, BatchMode batchMode) A frame, and optional callback, intended for the network layer.private CompressExtension.FrameEntry
void
setDeflaterPool
(org.eclipse.jetty.util.compression.DeflaterPool deflaterPool) void
setInflaterPool
(org.eclipse.jetty.util.compression.InflaterPool inflaterPool) private static boolean
supplyInput
(Deflater deflater, ByteBuffer buf) private static boolean
supplyInput
(Inflater inflater, ByteBuffer buf) private static String
private static String
toString()
Methods inherited from class org.eclipse.jetty.websocket.common.extensions.AbstractExtension
getBufferPool, getConfig, getConnection, getName, getNextIncoming, getNextOutgoing, getPolicy, init, init, isRsv2User, isRsv3User, nextIncomingFrame, nextOutgoingFrame, setBufferPool, setConfig, setConnection, setNextIncomingFrames, setNextOutgoingFrames, setPolicy
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, doStart, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.websocket.api.extensions.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:
isRsv1User
in interfaceExtension
- Overrides:
isRsv1User
in 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_ALWAYS
orRSV_USE_ONLY_FIRST
-
forwardIncoming
-
newByteAccumulator
-
decompress
- Throws:
DataFormatException
-
outgoingFrame
Description copied from interface:OutgoingFrames
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 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
- Overrides:
doStop
in classorg.eclipse.jetty.util.component.AbstractLifeCycle
- Throws:
Exception
-
toString
- Overrides:
toString
in classAbstractExtension
-