Class JavaxWebSocketServerContainer
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer
org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer
org.eclipse.jetty.websocket.javax.server.internal.JavaxWebSocketServerContainer
- All Implemented Interfaces:
EventListener
,javax.websocket.server.ServerContainer
,javax.websocket.WebSocketContainer
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
,LifeCycle.Listener
@ManagedObject("JSR356 Server Container")
public class JavaxWebSocketServerContainer
extends JavaxWebSocketClientContainer
implements javax.websocket.server.ServerContainer, LifeCycle.Listener
-
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
Fields inherited from class org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer
coreClient, coreClientFactory
Fields inherited from class org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer
components, defaultCustomizer, sessionTracker
-
Constructor Summary
ConstructorDescriptionJavaxWebSocketServerContainer
(WebSocketMappings webSocketMappings, WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientSupplier) Main entry point forJavaxWebSocketServletContainerInitializer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEndpoint
(Class<?> endpointClass) void
addEndpoint
(javax.websocket.server.ServerEndpointConfig providedConfig) protected void
protected void
protected void
doStart()
Starts the managed lifecycle beans in the order they were added.ensureContainer
(javax.servlet.ServletContext servletContext) getContainer
(javax.servlet.ServletContext servletContext) void
upgradeHttpToWebSocket
(Object httpServletRequest, Object httpServletResponse, javax.websocket.server.ServerEndpointConfig sec, Map<String, String> pathParameters) Methods inherited from class org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer
connectToServer, connectToServer, connectToServer, connectToServer, convertCause, doStop, getExecutor, getHttpClient, getWebSocketCoreClient, setShutdownContainer
Methods inherited from class org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer
addSessionListener, dump, getBufferPool, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getExtensionRegistry, getInstalledExtensions, getObjectFactory, getOpenSessions, getWebSocketComponents, newFrameHandler, notifySessionListeners, removeSessionListener, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, 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
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle.Listener
lifeCycleFailure, lifeCycleStarted, lifeCycleStarting, lifeCycleStopped, lifeCycleStopping
Methods inherited from interface javax.websocket.WebSocketContainer
connectToServer, connectToServer, connectToServer, connectToServer, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getInstalledExtensions, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
-
Field Details
-
JAVAX_WEBSOCKET_CONTAINER_ATTRIBUTE
-
PATH_PARAM_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
JavaxWebSocketServerContainer
public JavaxWebSocketServerContainer(WebSocketMappings webSocketMappings, WebSocketComponents components, Function<WebSocketComponents, WebSocketCoreClient> coreClientSupplier) Main entry point forJavaxWebSocketServletContainerInitializer
.- Parameters:
webSocketMappings
- theWebSocketMappings
that this container belongs tocomponents
- theWebSocketComponents
instance to usecoreClientSupplier
- the supplier of theWebSocketCoreClient
instance to use
-
-
Method Details
-
getContainer
public static JavaxWebSocketServerContainer getContainer(javax.servlet.ServletContext servletContext) -
ensureContainer
public static JavaxWebSocketServerContainer ensureContainer(javax.servlet.ServletContext servletContext) -
getFrameHandlerFactory
- Overrides:
getFrameHandlerFactory
in classJavaxWebSocketClientContainer
-
addEndpoint
- Specified by:
addEndpoint
in interfacejavax.websocket.server.ServerContainer
- Throws:
javax.websocket.DeploymentException
-
addEndpoint
public void addEndpoint(javax.websocket.server.ServerEndpointConfig providedConfig) throws javax.websocket.DeploymentException - Specified by:
addEndpoint
in interfacejavax.websocket.server.ServerContainer
- Throws:
javax.websocket.DeploymentException
-
upgradeHttpToWebSocket
public void upgradeHttpToWebSocket(Object httpServletRequest, Object httpServletResponse, javax.websocket.server.ServerEndpointConfig sec, Map<String, String> pathParameters) throws IOException, javax.websocket.DeploymentException- Throws:
IOException
javax.websocket.DeploymentException
-
doStart
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classJavaxWebSocketClientContainer
- Throws:
AbstractLifeCycle.StopException
- If thrown, the lifecycle will immediately be stopped.Exception
- If there was a problem starting. Will cause a transition to FAILED state
-
doClientStart
protected void doClientStart()- Overrides:
doClientStart
in classJavaxWebSocketClientContainer
-
doClientStop
protected void doClientStop()- Overrides:
doClientStop
in classJavaxWebSocketClientContainer
-