Top Description Fields Constructors Methods
org.eclipse.jetty.websocket.core.server

public Class WebSocketServerComponents

extends WebSocketComponents
Class Inheritance
Imports
java.util.concurrent.Executor, org.eclipse.jetty.io.ByteBufferPool, org.eclipse.jetty.server.Server, org.eclipse.jetty.server.handler.ContextHandler, org.eclipse.jetty.util.Attributes, .DecoratedObjectFactory, org.eclipse.jetty.util.component.ContainerLifeCycle, .LifeCycle, org.eclipse.jetty.util.compression.DeflaterPool, .InflaterPool, org.eclipse.jetty.websocket.core.WebSocketComponents, .WebSocketExtensionRegistry

A collection of components which are the resources needed for websockets such as ByteBufferPool, WebSocketExtensionRegistry, and DecoratedObjectFactory.

These components should be accessed through WebSocketServerComponents#getWebSocketComponents so that the instance can be shared by being stored as a bean on the ContextHandler.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
pack-priv
WebSocketServerComponents(InflaterPool inflaterPool, DeflaterPool deflaterPool, ByteBufferPool bufferPool, DecoratedObjectFactory objectFactory, Executor executor)

Method Summary

Modifier and TypeMethod and Description
public static WebSocketComponents

Returns:

the WebSocketComponents that was created or found on the ServletContext.
ensureWebSocketComponents
(Server
the server.
server
,
ContextHandler
the ContextHandler.
contextHandler
)

This ensures a WebSocketComponents is available at the ContextHandler attribute WEBSOCKET_COMPONENTS_ATTRIBUTE.

public static WebSocketComponents

Returns:

the WebSocketComponents that was created or found.
ensureWebSocketComponents
(Server
the server.
server
)

This ensures a WebSocketComponents is available on the Server attribute WEBSOCKET_COMPONENTS_ATTRIBUTE.

private static WebSocketComponents
ensureWebSocketComponents(Server
the server.
server
,
Attributes
the attributes where the websocket components can be found.
attributes
,
ContainerLifeCycle
the container to manage the lifecycle of the WebSocketComponents instance.
container
)

Returns: the WebSocketComponents that was created or found.

public static WebSocketComponents
public static WebSocketComponents
private static WebSocketComponents
Inherited from org.eclipse.jetty.websocket.core.WebSocketComponents:
getByteBufferPoolgetDeflaterPoolgetExecutorgetExtensionRegistrygetInflaterPoolgetObjectFactory

Field Detail

WEBSOCKET_BUFFER_POOL_ATTRIBUTEback to summary
public static final String WEBSOCKET_BUFFER_POOL_ATTRIBUTE
WEBSOCKET_COMPONENTS_ATTRIBUTEback to summary
public static final String WEBSOCKET_COMPONENTS_ATTRIBUTE
WEBSOCKET_DEFLATER_POOL_ATTRIBUTEback to summary
public static final String WEBSOCKET_DEFLATER_POOL_ATTRIBUTE
WEBSOCKET_INFLATER_POOL_ATTRIBUTEback to summary
public static final String WEBSOCKET_INFLATER_POOL_ATTRIBUTE

Constructor Detail

WebSocketServerComponentsback to summary
pack-priv WebSocketServerComponents(InflaterPool inflaterPool, DeflaterPool deflaterPool, ByteBufferPool bufferPool, DecoratedObjectFactory objectFactory, Executor executor)

Method Detail

ensureWebSocketComponentsback to summary
public static WebSocketComponents ensureWebSocketComponents(Server server, ContextHandler contextHandler)

This ensures a WebSocketComponents is available at the ContextHandler attribute WEBSOCKET_COMPONENTS_ATTRIBUTE.

This should be called when the server is starting.

Servlet context attributes can be set with WEBSOCKET_BUFFER_POOL_ATTRIBUTE, WEBSOCKET_INFLATER_POOL_ATTRIBUTE and WEBSOCKET_DEFLATER_POOL_ATTRIBUTE to override the ByteBufferPool, DeflaterPool or InflaterPool used by the components, otherwise this will try to use the pools shared on the Server.

Parameters
server:Server

the server.

contextHandler:ContextHandler

the ContextHandler.

Returns:WebSocketComponents

the WebSocketComponents that was created or found on the ServletContext.

ensureWebSocketComponentsback to summary
public static WebSocketComponents ensureWebSocketComponents(Server server)

This ensures a WebSocketComponents is available on the Server attribute WEBSOCKET_COMPONENTS_ATTRIBUTE.

This should be called when the server is starting.

Server attributes can be set with WEBSOCKET_BUFFER_POOL_ATTRIBUTE, WEBSOCKET_INFLATER_POOL_ATTRIBUTE and WEBSOCKET_DEFLATER_POOL_ATTRIBUTE to override the ByteBufferPool, DeflaterPool or InflaterPool used by the components, otherwise this will try to use the pools shared on the Server.

Parameters
server:Server

the server.

Returns:WebSocketComponents

the WebSocketComponents that was created or found.

ensureWebSocketComponentsback to summary
private static WebSocketComponents ensureWebSocketComponents(Server server, Attributes attributes, ContainerLifeCycle container)
Parameters
server:Server

the server.

attributes:Attributes

the attributes where the websocket components can be found.

container:ContainerLifeCycle

the container to manage the lifecycle of the WebSocketComponents instance.

Returns:WebSocketComponents

the WebSocketComponents that was created or found.

getWebSocketComponentsback to summary
public static WebSocketComponents getWebSocketComponents(ContextHandler contextHandler)
getWebSocketComponentsback to summary
public static WebSocketComponents getWebSocketComponents(Server server)
getWebSocketComponentsback to summary
private static WebSocketComponents getWebSocketComponents(Attributes attributes)