Class JettyWebSocketServerContainer
- All Implemented Interfaces:
- EventListener,- Container,- Destroyable,- Dumpable,- Dumpable.DumpableContainer,- LifeCycle,- LifeCycle.Listener,- WebSocketContainer,- WebSocketPolicy
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycleAbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.ContainerContainer.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.DumpableDumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycleLifeCycle.Listener
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddMapping(String pathSpec, Class<?> endpointClass) voidaddMapping(String pathSpec, JettyWebSocketCreator creator) voidaddSessionListener(WebSocketSessionListener listener) Register a WebSocketSessionListener with the containervoiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.ensureContainer(javax.servlet.ServletContext servletContext) getContainer(javax.servlet.ServletContext servletContext) The Container provided Executor.The duration that a websocket may be idle before being closed by the implementationintThe input (read from network layer) buffer size.longGet the maximum size of a binary message during parsing.longThe maximum payload size of any WebSocket Frame which can be received.longGet the maximum size of a text message during parsing.Get the collection of open Sessions being tracked by this containerintThe output (write to network layer) buffer size.booleanIf true, frames are automatically fragmented to respect the maximum frame size.voidNotify the Session Listeners of an event.booleanRemove a WebSocketSessionListener from the containervoidsetAutoFragment(boolean autoFragment) If set to true, frames are automatically fragmented to respect the maximum frame size.voidsetIdleTimeout(Duration duration) The duration that a websocket may be idle before being closed by the implementationvoidsetInputBufferSize(int size) The input (read from network layer) buffer size.voidsetMaxBinaryMessageSize(long size) The maximum size of a binary message during parsing/generating.voidsetMaxFrameSize(long maxFrameSize) The maximum payload size of any WebSocket Frame which can be received.voidsetMaxTextMessageSize(long size) The maximum size of a text message during parsing/generating.voidsetOutputBufferSize(int size) The output (write to network layer) buffer size.booleanupgrade(JettyWebSocketCreator creator, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) An immediate programmatic WebSocket upgrade that does not register a mapping or create aWebSocketUpgradeFilter.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycleaddBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCyclegetEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.ContainergetCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainerisDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle.ListenerlifeCycleFailure, lifeCycleStarted, lifeCycleStarting, lifeCycleStopped, lifeCycleStopping
- 
Field Details- 
JETTY_WEBSOCKET_CONTAINER_ATTRIBUTE
 
- 
- 
Method Details- 
getContainerpublic static JettyWebSocketServerContainer getContainer(javax.servlet.ServletContext servletContext) 
- 
ensureContainerpublic static JettyWebSocketServerContainer ensureContainer(javax.servlet.ServletContext servletContext) 
- 
addMapping
- 
addMapping
- 
upgradepublic boolean upgrade(JettyWebSocketCreator creator, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException An immediate programmatic WebSocket upgrade that does not register a mapping or create aWebSocketUpgradeFilter.- Parameters:
- creator- the WebSocketCreator to use.
- request- the HttpServletRequest.
- response- the HttpServletResponse.
- Returns:
- true if the connection was successfully upgraded to WebSocket.
- Throws:
- IOException- if an I/O error occurs.
 
- 
getExecutorDescription copied from interface:WebSocketContainerThe Container provided Executor.- Specified by:
- getExecutorin interface- WebSocketContainer
 
- 
addSessionListenerDescription copied from interface:WebSocketContainerRegister a WebSocketSessionListener with the container- Specified by:
- addSessionListenerin interface- WebSocketContainer
- Parameters:
- listener- the listener
 
- 
removeSessionListenerDescription copied from interface:WebSocketContainerRemove a WebSocketSessionListener from the container- Specified by:
- removeSessionListenerin interface- WebSocketContainer
- Parameters:
- listener- the listener
- Returns:
- true if listener was present and removed
 
- 
notifySessionListenersDescription copied from interface:WebSocketContainerNotify the Session Listeners of an event.- Specified by:
- notifySessionListenersin interface- WebSocketContainer
- Parameters:
- consumer- the consumer to call for each tracked listener
 
- 
getOpenSessionsDescription copied from interface:WebSocketContainerGet the collection of open Sessions being tracked by this container- Specified by:
- getOpenSessionsin interface- WebSocketContainer
- Returns:
- the collection of open sessions
 
- 
getBehavior- Specified by:
- getBehaviorin interface- WebSocketPolicy
 
- 
getIdleTimeoutDescription copied from interface:WebSocketPolicyThe duration that a websocket may be idle before being closed by the implementation- Specified by:
- getIdleTimeoutin interface- WebSocketPolicy
- Returns:
- the timeout duration
 
- 
getInputBufferSizepublic int getInputBufferSize()Description copied from interface:WebSocketPolicyThe input (read from network layer) buffer size.This is the raw read operation buffer size, before the parsing of the websocket frames. - Specified by:
- getInputBufferSizein interface- WebSocketPolicy
- Returns:
- the raw network buffer input size.
 
- 
getOutputBufferSizepublic int getOutputBufferSize()Description copied from interface:WebSocketPolicyThe output (write to network layer) buffer size.This is the raw write operation buffer size and has no relationship to the websocket frame. - Specified by:
- getOutputBufferSizein interface- WebSocketPolicy
- Returns:
- the raw network buffer output size.
 
- 
getMaxBinaryMessageSizepublic long getMaxBinaryMessageSize()Description copied from interface:WebSocketPolicyGet the maximum size of a binary message during parsing.This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling binary messages. This applies to individual frames, whole message handling, and partial message handling. Binary messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE- Specified by:
- getMaxBinaryMessageSizein interface- WebSocketPolicy
- Returns:
- the maximum size of a binary message
 
- 
getMaxTextMessageSizepublic long getMaxTextMessageSize()Description copied from interface:WebSocketPolicyGet the maximum size of a text message during parsing.This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling text messages. This applies to individual frames, whole message handling, and partial message handling. Text messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE- Specified by:
- getMaxTextMessageSizein interface- WebSocketPolicy
- Returns:
- the maximum size of a text message.
 
- 
getMaxFrameSizepublic long getMaxFrameSize()Description copied from interface:WebSocketPolicyThe maximum payload size of any WebSocket Frame which can be received.- Specified by:
- getMaxFrameSizein interface- WebSocketPolicy
- Returns:
- the maximum size of a WebSocket Frame.
 
- 
isAutoFragmentpublic boolean isAutoFragment()Description copied from interface:WebSocketPolicyIf true, frames are automatically fragmented to respect the maximum frame size.- Specified by:
- isAutoFragmentin interface- WebSocketPolicy
- Returns:
- whether to automatically fragment incoming WebSocket Frames.
 
- 
setIdleTimeoutDescription copied from interface:WebSocketPolicyThe duration that a websocket may be idle before being closed by the implementation- Specified by:
- setIdleTimeoutin interface- WebSocketPolicy
- Parameters:
- duration- the timeout duration (may not be null or negative)
 
- 
setInputBufferSizepublic void setInputBufferSize(int size) Description copied from interface:WebSocketPolicyThe input (read from network layer) buffer size.- Specified by:
- setInputBufferSizein interface- WebSocketPolicy
- Parameters:
- size- the size in bytes
 
- 
setOutputBufferSizepublic void setOutputBufferSize(int size) Description copied from interface:WebSocketPolicyThe output (write to network layer) buffer size.- Specified by:
- setOutputBufferSizein interface- WebSocketPolicy
- Parameters:
- size- the size in bytes
 
- 
setMaxBinaryMessageSizepublic void setMaxBinaryMessageSize(long size) Description copied from interface:WebSocketPolicyThe maximum size of a binary message during parsing/generating.Binary messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE- Specified by:
- setMaxBinaryMessageSizein interface- WebSocketPolicy
- Parameters:
- size- the maximum allowed size of a binary message.
 
- 
setMaxTextMessageSizepublic void setMaxTextMessageSize(long size) Description copied from interface:WebSocketPolicyThe maximum size of a text message during parsing/generating.Text messages over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE- Specified by:
- setMaxTextMessageSizein interface- WebSocketPolicy
- Parameters:
- size- the maximum allowed size of a text message.
 
- 
setMaxFrameSizepublic void setMaxFrameSize(long maxFrameSize) Description copied from interface:WebSocketPolicyThe maximum payload size of any WebSocket Frame which can be received.WebSocket Frames over this maximum will result in a close code 1009 StatusCode.MESSAGE_TOO_LARGE- Specified by:
- setMaxFrameSizein interface- WebSocketPolicy
- Parameters:
- maxFrameSize- the maximum allowed size of a WebSocket Frame.
 
- 
setAutoFragmentpublic void setAutoFragment(boolean autoFragment) Description copied from interface:WebSocketPolicyIf set to true, frames are automatically fragmented to respect the maximum frame size.- Specified by:
- setAutoFragmentin interface- WebSocketPolicy
- Parameters:
- autoFragment- whether to automatically fragment incoming WebSocket Frames.
 
- 
dumpDescription copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
- dumpin interface- Dumpable
- Overrides:
- dumpin class- ContainerLifeCycle
- Parameters:
- out- The appendable to dump to
- indent- The indent to apply after any new lines.
- Throws:
- IOException- if unable to write to Appendable
 
 
-