| Modifier and Type | Field and Description |
|---|---|
| private final WebSocketComponents | |
| private final ServletContextHandler | |
| private final Configuration. | |
| private final Executor | |
| private final JettyServerFrameHandlerFactory | |
| public static final String | |
| private static final Logger | |
| private final List | |
| private final SessionTracker | |
| private final WebSocketMappings |
| Access | Constructor and Description |
|---|---|
| pack-priv | JettyWebSocketServerContainer(ServletContextHandler contextHandler, WebSocketMappings
the webSocketMappings, WebSocketComponents components, Executor WebSocketMappings that this container belongs tothe executor)Executor to useMain entry point for |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | addSessionListener(WebSocketSessionListener
the listener listener)Implements org. Register a WebSocketSessionListener with the container |
| public void | dump(Appendable
The appendable to dump to out, String The indent to apply after any new lines. indent)Overrides org. Implements org. Dump this object (and children) into an Appendable using the provided indent after any new lines. |
| public static JettyWebSocketServerContainer | |
| public static JettyWebSocketServerContainer | |
| public Executor | getExecutor()
Implements org. The Container provided Executor. |
| public Duration | getIdleTimeout()
Implements org. The duration that a websocket may be idle before being closed by the implementation |
| public int | getInputBufferSize()
Implements org. The input (read from network layer) buffer size. |
| public long | getMaxBinaryMessageSize()
Implements org. Get the maximum size of a binary message during parsing. |
| public long | getMaxFrameSize()
Implements org. The maximum payload size of any WebSocket Frame which can be received. |
| public int | getMaxOutgoingFrames()
Implements org. Get the maximum number of data frames allowed to be waiting to be sent at any one time. |
| public long | getMaxTextMessageSize()
Implements org. Get the maximum size of a text message during parsing. |
| public Collection | getOpenSessions()
Implements org. Get the collection of open Sessions being tracked by this container |
| public int | getOutputBufferSize()
Implements org. The output (write to network layer) buffer size. |
| public boolean | isAutoFragment()
Implements org. If true, frames are automatically fragmented to respect the maximum frame size. |
| public void | notifySessionListeners(Consumer<WebSocketSessionListener>
the consumer to call for each tracked listener consumer)Implements org. Notify the Session Listeners of an event. |
| public boolean | removeSessionListener(WebSocketSessionListener
the listener listener)Implements org. Remove a WebSocketSessionListener from the container |
| public void | setAutoFragment(boolean
whether to automatically fragment incoming WebSocket Frames. autoFragment)Implements org. If set to true, frames are automatically fragmented to respect the maximum frame size. |
| public void | setIdleTimeout(Duration
the timeout duration (may not be null or negative) duration)Implements org. The duration that a websocket may be idle before being closed by the implementation |
| public void | setInputBufferSize(int
the size in bytes size)Implements org. The input (read from network layer) buffer size. |
| public void | setMaxBinaryMessageSize(long
the maximum allowed size of a binary message. size)Implements org. The maximum size of a binary message during parsing/generating. |
| public void | setMaxFrameSize(long
the maximum allowed size of a WebSocket Frame. maxFrameSize)Implements org. The maximum payload size of any WebSocket Frame which can be received. |
| public void | setMaxOutgoingFrames(int
the max number of frames. maxOutgoingFrames)Implements org. Set the maximum number of data frames allowed to be waiting to be sent at any one time. |
| public void | setMaxTextMessageSize(long
the maximum allowed size of a text message. size)Implements org. The maximum size of a text message during parsing/generating. |
| public void | setOutputBufferSize(int
the size in bytes size)Implements org. The output (write to network layer) buffer size. |
| public boolean | Returns: true if the connection could be upgraded or an error was sent.the WebSocketCreator to use. creator, HttpServletRequest the HttpServletRequest. request, HttpServletResponse the HttpServletResponse. response)An immediate programmatic WebSocket upgrade that does not register a mapping or create a |
| components | back to summary |
|---|---|
| private final WebSocketComponents components | |
| contextHandler | back to summary |
|---|---|
| private final ServletContextHandler contextHandler | |
| customizer | back to summary |
|---|---|
| private final Configuration. | |
| executor | back to summary |
|---|---|
| private final Executor executor | |
| frameHandlerFactory | back to summary |
|---|---|
| private final JettyServerFrameHandlerFactory frameHandlerFactory | |
| JETTY_WEBSOCKET_CONTAINER_ATTRIBUTE | back to summary |
|---|---|
| public static final String JETTY_WEBSOCKET_CONTAINER_ATTRIBUTE | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Hides org. | |
| sessionListeners | back to summary |
|---|---|
| private final List<WebSocketSessionListener> sessionListeners | |
| sessionTracker | back to summary |
|---|---|
| private final SessionTracker sessionTracker | |
| webSocketMappings | back to summary |
|---|---|
| private final WebSocketMappings webSocketMappings | |
| JettyWebSocketServerContainer | back to summary |
|---|---|
| pack-priv JettyWebSocketServerContainer(ServletContextHandler contextHandler, WebSocketMappings webSocketMappings, WebSocketComponents components, Executor executor) Main entry point for
| |
| addMapping | back to summary |
|---|---|
| public void addMapping(String pathSpec, JettyWebSocketCreator creator) | |
| addMapping | back to summary |
|---|---|
| public void addMapping(String pathSpec, final Class<?> endpointClass) | |
| addSessionListener | back to summary |
|---|---|
| public void addSessionListener(WebSocketSessionListener listener) Implements org. Doc from org. Register a WebSocketSessionListener with the container
| |
| dump | back to summary |
|---|---|
| public void dump(Appendable out, String indent) throws IOException Overrides org. Implements org. Doc from org. Dump 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.
| |
| ensureContainer | back to summary |
|---|---|
| public static JettyWebSocketServerContainer ensureContainer(ServletContext servletContext) | |
| getContainer | back to summary |
|---|---|
| public static JettyWebSocketServerContainer getContainer(ServletContext servletContext) | |
| getExecutor | back to summary |
|---|---|
| public Executor getExecutor() Implements org. Doc from org. The Container provided Executor.
| |
| getIdleTimeout | back to summary |
|---|---|
| public Duration getIdleTimeout() Implements org. Doc from org. The duration that a websocket may be idle before being closed by the implementation | |
| getInputBufferSize | back to summary |
|---|---|
| public int getInputBufferSize() Implements org. Doc from org. The input (read from network layer) buffer size. This is the raw read operation buffer size, before the parsing of the websocket frames.
| |
| getMaxBinaryMessageSize | back to summary |
|---|---|
| public long getMaxBinaryMessageSize() Implements org. Doc from org. Get 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
| |
| getMaxFrameSize | back to summary |
|---|---|
| public long getMaxFrameSize() Implements org. Doc from org. The maximum payload size of any WebSocket Frame which can be received.
| |
| getMaxOutgoingFrames | back to summary |
|---|---|
| public int getMaxOutgoingFrames() Implements org. Doc from org. Get the maximum number of data frames allowed to be waiting to be sent at any one time.
The default value is -1, this indicates there is no limit on how many frames can be
queued to be sent by the implementation. If the limit is exceeded, subsequent frames
sent are failed with a
| |
| getMaxTextMessageSize | back to summary |
|---|---|
| public long getMaxTextMessageSize() Implements org. Doc from org. Get 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
| |
| getOpenSessions | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Get the collection of open Sessions being tracked by this container
| |
| getOutputBufferSize | back to summary |
|---|---|
| public int getOutputBufferSize() Implements org. Doc from org. The output (write to network layer) buffer size. This is the raw write operation buffer size and has no relationship to the websocket frame.
| |
| isAutoFragment | back to summary |
|---|---|
| public boolean isAutoFragment() Implements org. Doc from org. If true, frames are automatically fragmented to respect the maximum frame size.
| |
| notifySessionListeners | back to summary |
|---|---|
| public void notifySessionListeners(Consumer<WebSocketSessionListener> consumer) Implements org. Doc from org. Notify the Session Listeners of an event.
| |
| removeSessionListener | back to summary |
|---|---|
| public boolean removeSessionListener(WebSocketSessionListener listener) Implements org. Doc from org. Remove a WebSocketSessionListener from the container
| |
| setAutoFragment | back to summary |
|---|---|
| public void setAutoFragment(boolean autoFragment) Implements org. Doc from org. If set to true, frames are automatically fragmented to respect the maximum frame size.
| |
| setIdleTimeout | back to summary |
|---|---|
| public void setIdleTimeout(Duration duration) Implements org. Doc from org. The duration that a websocket may be idle before being closed by the implementation | |
| setInputBufferSize | back to summary |
|---|---|
| public void setInputBufferSize(int size) Implements org. Doc from org. The input (read from network layer) buffer size.
| |
| setMaxBinaryMessageSize | back to summary |
|---|---|
| public void setMaxBinaryMessageSize(long size) Implements org. Doc from org. The maximum size of a binary message during parsing/generating.
Binary messages over this maximum will result in a close code 1009
| |
| setMaxFrameSize | back to summary |
|---|---|
| public void setMaxFrameSize(long maxFrameSize) Implements org. Doc from org. The maximum payload size of any WebSocket Frame which can be received.
WebSocket Frames over this maximum will result in a close code 1009
| |
| setMaxOutgoingFrames | back to summary |
|---|---|
| public void setMaxOutgoingFrames(int maxOutgoingFrames) Implements org. Doc from org. Set the maximum number of data frames allowed to be waiting to be sent at any one time.
The default value is -1, this indicates there is no limit on how many frames can be
queued to be sent by the implementation. If the limit is exceeded, subsequent frames
sent are failed with a
| |
| setMaxTextMessageSize | back to summary |
|---|---|
| public void setMaxTextMessageSize(long size) Implements org. Doc from org. The maximum size of a text message during parsing/generating.
Text messages over this maximum will result in a close code 1009
| |
| setOutputBufferSize | back to summary |
|---|---|
| public void setOutputBufferSize(int size) Implements org. Doc from org. The output (write to network layer) buffer size.
| |
| upgrade | back to summary |
|---|---|
| public boolean upgrade(JettyWebSocketCreator creator, HttpServletRequest request, HttpServletResponse response) throws IOException An immediate programmatic WebSocket upgrade that does not register a mapping or create a A return value of true means the connection was Upgraded to WebSocket or an error response is being generated. A return value of false means that it was a bad upgrade request and couldn't be upgraded to WebSocket and the caller is responsible for generating the response.
| |