Class WebSocketServerComponents
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.websocket.core.WebSocketComponents
org.eclipse.jetty.websocket.core.server.WebSocketServerComponents
- All Implemented Interfaces:
Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
A collection of components which are the resources needed for websockets such as
ByteBufferPool
, WebSocketExtensionRegistry
, and DecoratedObjectFactory
.
These components should be accessed through getWebSocketComponents(jakarta.servlet.ServletContext)
so that
the instance can be shared by being stored as a bean on the ContextHandler.-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebSocketComponents
ensureWebSocketComponents
(Server server, jakarta.servlet.ServletContext servletContext) This ensures aWebSocketComponents
is available at theServletContext
attributeWEBSOCKET_COMPONENTS_ATTRIBUTE
.static WebSocketComponents
getWebSocketComponents
(jakarta.servlet.ServletContext servletContext) Methods inherited from class org.eclipse.jetty.websocket.core.WebSocketComponents
getBufferPool, getDeflaterPool, getExecutor, getExtensionRegistry, getInflaterPool, getObjectFactory
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Field Details
-
WEBSOCKET_COMPONENTS_ATTRIBUTE
-
WEBSOCKET_INFLATER_POOL_ATTRIBUTE
- See Also:
-
WEBSOCKET_DEFLATER_POOL_ATTRIBUTE
- See Also:
-
WEBSOCKET_BUFFER_POOL_ATTRIBUTE
- See Also:
-
-
Method Details
-
ensureWebSocketComponents
public static WebSocketComponents ensureWebSocketComponents(Server server, jakarta.servlet.ServletContext servletContext) This ensures a
WebSocketComponents
is available at theServletContext
attributeWEBSOCKET_COMPONENTS_ATTRIBUTE
.This should be called when the server is starting, usually by a
ServletContainerInitializer
.Servlet context attributes can be set with
WEBSOCKET_BUFFER_POOL_ATTRIBUTE
,WEBSOCKET_INFLATER_POOL_ATTRIBUTE
andWEBSOCKET_DEFLATER_POOL_ATTRIBUTE
to override theByteBufferPool
,DeflaterPool
orInflaterPool
used by the components, otherwise this will try to use the pools shared on theServer
.- Parameters:
server
- the server.servletContext
- the ServletContext.- Returns:
- the WebSocketComponents that was created or found on the ServletContext.
-
getWebSocketComponents
public static WebSocketComponents getWebSocketComponents(jakarta.servlet.ServletContext servletContext)
-