Class ExtensionStack
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.websocket.common.extensions.ExtensionStack
-
- All Implemented Interfaces:
org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle,IncomingFrames,OutgoingFrames
@ManagedObject("Extension Stack") public class ExtensionStack extends org.eclipse.jetty.util.component.ContainerLifeCycle implements IncomingFrames, OutgoingFramesRepresents the stack of Extensions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classExtensionStack.Flusherprivate static classExtensionStack.FrameEntry-
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.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Queue<ExtensionStack.FrameEntry>entriesprivate java.util.List<Extension>extensionsprivate ExtensionFactoryfactoryprivate org.eclipse.jetty.util.IteratingCallbackflusherprivate static org.eclipse.jetty.util.log.LoggerLOGprivate IncomingFramesnextIncomingprivate OutgoingFramesnextOutgoing
-
Constructor Summary
Constructors Constructor Description ExtensionStack(ExtensionFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Generator generator)voidconfigure(Parser parser)protected voiddoStart()java.lang.StringdumpSelf()java.util.List<Extension>getExtensions()private IncomingFramesgetLastIncoming()private OutgoingFramesgetLastOutgoing()java.util.List<ExtensionConfig>getNegotiatedExtensions()Get the list of negotiated extensions, each entry being a full "name; params" extension configurationIncomingFramesgetNextIncoming()OutgoingFramesgetNextOutgoing()private intgetQueueSize()booleanhasNegotiatedExtensions()voidincomingFrame(Frame frame)Process the incoming frame.voidnegotiate(java.util.List<ExtensionConfig> configs)Perform the extension negotiation.private voidofferEntry(ExtensionStack.FrameEntry entry)voidoutgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)A frame, and optional callback, intended for the network layer.private ExtensionStack.FrameEntrypollEntry()voidsetNextIncoming(IncomingFrames nextIncoming)voidsetNextOutgoing(OutgoingFrames nextOutgoing)voidsetPolicy(WebSocketPolicy policy)java.lang.StringtoString()-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Field Detail
-
LOG
private static final org.eclipse.jetty.util.log.Logger LOG
-
entries
private final java.util.Queue<ExtensionStack.FrameEntry> entries
-
flusher
private final org.eclipse.jetty.util.IteratingCallback flusher
-
factory
private final ExtensionFactory factory
-
extensions
private java.util.List<Extension> extensions
-
nextIncoming
private IncomingFrames nextIncoming
-
nextOutgoing
private OutgoingFrames nextOutgoing
-
-
Constructor Detail
-
ExtensionStack
public ExtensionStack(ExtensionFactory factory)
-
-
Method Detail
-
configure
public void configure(Generator generator)
-
configure
public void configure(Parser parser)
-
doStart
protected void doStart() throws java.lang.Exception- Overrides:
doStartin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
java.lang.Exception
-
dumpSelf
public java.lang.String dumpSelf()
- Specified by:
dumpSelfin interfaceorg.eclipse.jetty.util.component.Dumpable
-
getExtensions
@ManagedAttribute(name="Extension List", readonly=true) public java.util.List<Extension> getExtensions()
-
getLastIncoming
private IncomingFrames getLastIncoming()
-
getLastOutgoing
private OutgoingFrames getLastOutgoing()
-
getNegotiatedExtensions
public java.util.List<ExtensionConfig> getNegotiatedExtensions()
Get the list of negotiated extensions, each entry being a full "name; params" extension configuration- Returns:
- list of negotiated extensions
-
getNextIncoming
@ManagedAttribute(name="Next Incoming Frames Handler", readonly=true) public IncomingFrames getNextIncoming()
-
getNextOutgoing
@ManagedAttribute(name="Next Outgoing Frames Handler", readonly=true) public OutgoingFrames getNextOutgoing()
-
hasNegotiatedExtensions
public boolean hasNegotiatedExtensions()
-
incomingFrame
public void incomingFrame(Frame frame)
Description copied from interface:IncomingFramesProcess 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.
- Specified by:
incomingFramein interfaceIncomingFrames- Parameters:
frame- the frame to process
-
negotiate
public void negotiate(java.util.List<ExtensionConfig> configs)
Perform the extension negotiation.For the list of negotiated extensions, use
getNegotiatedExtensions()- Parameters:
configs- the configurations being requested
-
outgoingFrame
public void outgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)
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.
- Specified by:
outgoingFramein interfaceOutgoingFrames- 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.
-
setNextIncoming
public void setNextIncoming(IncomingFrames nextIncoming)
-
setNextOutgoing
public void setNextOutgoing(OutgoingFrames nextOutgoing)
-
setPolicy
public void setPolicy(WebSocketPolicy policy)
-
offerEntry
private void offerEntry(ExtensionStack.FrameEntry entry)
-
pollEntry
private ExtensionStack.FrameEntry pollEntry()
-
getQueueSize
private int getQueueSize()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-
-