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:
Dumpable
,LifeCycle
,Extension
,IncomingFrames
,OutgoingFrames
- Direct Known Subclasses:
DeflateFrameExtension
,PerMessageDeflateExtension
public abstract class CompressExtension extends AbstractExtension
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicInteger
decompressCount
protected static int
INFLATE_BUFFER_SIZE
Inflater / Decompressed Buffer Sizeprotected static int
INPUT_MAX_BUFFER_SIZE
Deflater / Inflater: Maximum Input Buffer Sizeprotected static int
RSV_USE_ALWAYS
Always set RSV flag, on all frame typesprotected static int
RSV_USE_ONLY_FIRST
Only set RSV flag on first frame in multi-frame messages.protected static byte[]
TAIL_BYTES
protected static ByteBuffer
TAIL_BYTES_BUF
protected static int
TAIL_DROP_ALWAYS
Always drop tail bytes 0000FFFF, from all frame typesprotected static int
TAIL_DROP_FIN_ONLY
Only drop tail bytes 0000FFFF, from fin==true framesprotected static int
TAIL_DROP_NEVER
Never drop tail bytes 0000FFFF, from any frame type-
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CompressExtension()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decompress(ByteAccumulator accumulator, ByteBuffer buf)
protected void
doStop()
static boolean
endsWithTail(ByteBuffer buf)
protected void
forwardIncoming(Frame frame, ByteAccumulator accumulator)
Deflater
getDeflater()
Inflater
getInflater()
boolean
isRsv1User()
Indicates use of RSV1 flag for indicating deflation is in use.protected ByteAccumulator
newByteAccumulator()
protected void
notifyCallbackFailure(WriteCallback callback, Throwable failure)
protected void
notifyCallbackSuccess(WriteCallback callback)
void
outgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)
String
toString()
-
Methods inherited from class org.eclipse.jetty.websocket.common.extensions.AbstractExtension
dump, dump, dumpWithHeading, getBufferPool, getConfig, getConnection, getName, getNextIncoming, getNextOutgoing, getPolicy, incomingError, init, isRsv2User, isRsv3User, nextIncomingError, 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 Detail
-
TAIL_BYTES
protected static final byte[] TAIL_BYTES
-
TAIL_BYTES_BUF
protected static final ByteBuffer TAIL_BYTES_BUF
-
TAIL_DROP_NEVER
protected static final int TAIL_DROP_NEVER
Never drop tail bytes 0000FFFF, from any frame type- See Also:
- Constant Field Values
-
TAIL_DROP_ALWAYS
protected static final int TAIL_DROP_ALWAYS
Always drop tail bytes 0000FFFF, from all frame types- See Also:
- Constant Field Values
-
TAIL_DROP_FIN_ONLY
protected static final int TAIL_DROP_FIN_ONLY
Only drop tail bytes 0000FFFF, from fin==true frames- See Also:
- Constant Field Values
-
RSV_USE_ALWAYS
protected static final int RSV_USE_ALWAYS
Always set RSV flag, on all frame types- See Also:
- Constant Field Values
-
RSV_USE_ONLY_FIRST
protected static final int RSV_USE_ONLY_FIRST
Only set RSV flag on first frame in multi-frame messages.Note: this automatically means no-continuation frames have the RSV bit set
- See Also:
- Constant Field Values
-
INFLATE_BUFFER_SIZE
protected static final int INFLATE_BUFFER_SIZE
Inflater / Decompressed Buffer Size- See Also:
- Constant Field Values
-
INPUT_MAX_BUFFER_SIZE
protected static final int INPUT_MAX_BUFFER_SIZE
Deflater / Inflater: Maximum Input Buffer Size- See Also:
- Constant Field Values
-
decompressCount
protected AtomicInteger decompressCount
-
-
Method Detail
-
getDeflater
public Deflater getDeflater()
-
getInflater
public Inflater 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.
-
forwardIncoming
protected void forwardIncoming(Frame frame, ByteAccumulator accumulator)
-
newByteAccumulator
protected ByteAccumulator newByteAccumulator()
-
decompress
protected void decompress(ByteAccumulator accumulator, ByteBuffer buf) throws DataFormatException
- Throws:
DataFormatException
-
outgoingFrame
public void outgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)
-
notifyCallbackSuccess
protected void notifyCallbackSuccess(WriteCallback callback)
-
notifyCallbackFailure
protected void notifyCallbackFailure(WriteCallback callback, Throwable failure)
-
endsWithTail
public static boolean endsWithTail(ByteBuffer buf)
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classAbstractLifeCycle
- Throws:
Exception
-
toString
public String toString()
- Overrides:
toString
in classAbstractExtension
-
-