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(javax.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.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic WebSocketComponentsensureWebSocketComponents(Server server, javax.servlet.ServletContext servletContext) This ensures aWebSocketComponentsis available at theServletContextattributeWEBSOCKET_COMPONENTS_ATTRIBUTE.static WebSocketComponentsgetWebSocketComponents(javax.servlet.ServletContext servletContext) Methods inherited from class org.eclipse.jetty.websocket.core.WebSocketComponents
getBufferPool, getDeflaterPool, getExecutor, getExtensionRegistry, getInflaterPool, getObjectFactoryMethods 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, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods 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, javax.servlet.ServletContext servletContext) This ensures a
WebSocketComponentsis available at theServletContextattributeWEBSOCKET_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_ATTRIBUTEandWEBSOCKET_DEFLATER_POOL_ATTRIBUTEto override theByteBufferPool,DeflaterPoolorInflaterPoolused 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(javax.servlet.ServletContext servletContext)
-