Class ServerContainer
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.websocket.jsr356.ClientContainer
-
- org.eclipse.jetty.websocket.jsr356.server.ServerContainer
-
- All Implemented Interfaces:
javax.websocket.server.ServerContainer
,javax.websocket.WebSocketContainer
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
,WebSocketContainerScope
@ManagedObject("JSR356 Server Container") public class ServerContainer extends ClientContainer implements javax.websocket.server.ServerContainer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
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 Modifier and Type Field Description static java.lang.String
PATH_PARAM_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description ServerContainer(NativeWebSocketConfiguration configuration, java.util.concurrent.Executor executor)
Deprecated.useServerContainer(NativeWebSocketConfiguration, HttpClient)
insteadServerContainer(NativeWebSocketConfiguration configuration, HttpClient httpClient)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEndpoint(java.lang.Class<?> endpointClass)
void
addEndpoint(javax.websocket.server.ServerEndpointConfig config)
protected void
doStart()
Starts the managed lifecycle beans in the order they were added.long
getDefaultAsyncSendTimeout()
int
getDefaultMaxBinaryMessageBufferSize()
long
getDefaultMaxSessionIdleTimeout()
int
getDefaultMaxTextMessageBufferSize()
ServerEndpointMetadata
getServerEndpointMetadata(java.lang.Class<?> endpoint, javax.websocket.server.ServerEndpointConfig config)
static javax.websocket.WebSocketContainer
getWebSocketContainer()
Get the WebSocketContainer out of the current ThreadLocal reference of the active ContextHandler.WebSocketServerFactory
getWebSocketServerFactory()
EndpointInstance
newClientEndpointInstance(java.lang.Object endpoint, javax.websocket.server.ServerEndpointConfig config, java.lang.String path)
void
setAsyncSendTimeout(long ms)
void
setDefaultMaxBinaryMessageBufferSize(int max)
void
setDefaultMaxSessionIdleTimeout(long ms)
void
setDefaultMaxTextMessageBufferSize(int max)
void
upgradeHttpToWebSocket(java.lang.Object httpServletRequest, java.lang.Object httpServletResponse, javax.websocket.server.ServerEndpointConfig sec, java.util.Map<java.lang.String,java.lang.String> pathParameters)
-
Methods inherited from class org.eclipse.jetty.websocket.jsr356.ClientContainer
addSessionListener, connectToServer, connectToServer, connectToServer, connectToServer, doStop, getBufferPool, getClassLoader, getClient, getClientEndpointMetadata, getDecoderFactory, getEncoderFactory, getExecutor, getInstalledExtensions, getObjectFactory, getOpenSessions, getPolicy, getSessionListeners, getSslContextFactory, newClientEndpointInstance, removeSessionListener
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, 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.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface javax.websocket.WebSocketContainer
connectToServer, connectToServer, connectToServer, connectToServer, getInstalledExtensions
-
Methods inherited from interface org.eclipse.jetty.websocket.common.scopes.WebSocketContainerScope
isRunning
-
-
-
-
Field Detail
-
PATH_PARAM_ATTRIBUTE
public static final java.lang.String PATH_PARAM_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServerContainer
@Deprecated public ServerContainer(NativeWebSocketConfiguration configuration, java.util.concurrent.Executor executor)
Deprecated.useServerContainer(NativeWebSocketConfiguration, HttpClient)
instead- Parameters:
configuration
- theNativeWebSocketConfiguration
to useexecutor
- not used
-
ServerContainer
public ServerContainer(NativeWebSocketConfiguration configuration, HttpClient httpClient)
- Parameters:
configuration
- theNativeWebSocketConfiguration
to usehttpClient
- theHttpClient
instance to use
-
-
Method Detail
-
getWebSocketContainer
public static javax.websocket.WebSocketContainer getWebSocketContainer()
Get the WebSocketContainer out of the current ThreadLocal reference of the active ContextHandler.- Returns:
- the WebSocketContainer if found, null if not found.
-
newClientEndpointInstance
public EndpointInstance newClientEndpointInstance(java.lang.Object endpoint, javax.websocket.server.ServerEndpointConfig config, java.lang.String path)
-
addEndpoint
public void addEndpoint(java.lang.Class<?> endpointClass) throws javax.websocket.DeploymentException
- Specified by:
addEndpoint
in interfacejavax.websocket.server.ServerContainer
- Throws:
javax.websocket.DeploymentException
-
addEndpoint
public void addEndpoint(javax.websocket.server.ServerEndpointConfig config) throws javax.websocket.DeploymentException
- Specified by:
addEndpoint
in interfacejavax.websocket.server.ServerContainer
- Throws:
javax.websocket.DeploymentException
-
doStart
protected void doStart() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classClientContainer
- Throws:
java.lang.Exception
-
getServerEndpointMetadata
public ServerEndpointMetadata getServerEndpointMetadata(java.lang.Class<?> endpoint, javax.websocket.server.ServerEndpointConfig config) throws javax.websocket.DeploymentException
- Throws:
javax.websocket.DeploymentException
-
getDefaultAsyncSendTimeout
public long getDefaultAsyncSendTimeout()
- Specified by:
getDefaultAsyncSendTimeout
in interfacejavax.websocket.WebSocketContainer
- Overrides:
getDefaultAsyncSendTimeout
in classClientContainer
-
getDefaultMaxBinaryMessageBufferSize
public int getDefaultMaxBinaryMessageBufferSize()
- Specified by:
getDefaultMaxBinaryMessageBufferSize
in interfacejavax.websocket.WebSocketContainer
- Overrides:
getDefaultMaxBinaryMessageBufferSize
in classClientContainer
-
getDefaultMaxSessionIdleTimeout
public long getDefaultMaxSessionIdleTimeout()
- Specified by:
getDefaultMaxSessionIdleTimeout
in interfacejavax.websocket.WebSocketContainer
- Overrides:
getDefaultMaxSessionIdleTimeout
in classClientContainer
-
getDefaultMaxTextMessageBufferSize
public int getDefaultMaxTextMessageBufferSize()
- Specified by:
getDefaultMaxTextMessageBufferSize
in interfacejavax.websocket.WebSocketContainer
- Overrides:
getDefaultMaxTextMessageBufferSize
in classClientContainer
-
getWebSocketServerFactory
public WebSocketServerFactory getWebSocketServerFactory()
-
upgradeHttpToWebSocket
public void upgradeHttpToWebSocket(java.lang.Object httpServletRequest, java.lang.Object httpServletResponse, javax.websocket.server.ServerEndpointConfig sec, java.util.Map<java.lang.String,java.lang.String> pathParameters) throws java.io.IOException, javax.websocket.DeploymentException
- Throws:
java.io.IOException
javax.websocket.DeploymentException
-
setAsyncSendTimeout
public void setAsyncSendTimeout(long ms)
- Specified by:
setAsyncSendTimeout
in interfacejavax.websocket.WebSocketContainer
- Overrides:
setAsyncSendTimeout
in classClientContainer
-
setDefaultMaxBinaryMessageBufferSize
public void setDefaultMaxBinaryMessageBufferSize(int max)
- Specified by:
setDefaultMaxBinaryMessageBufferSize
in interfacejavax.websocket.WebSocketContainer
- Overrides:
setDefaultMaxBinaryMessageBufferSize
in classClientContainer
-
setDefaultMaxSessionIdleTimeout
public void setDefaultMaxSessionIdleTimeout(long ms)
- Specified by:
setDefaultMaxSessionIdleTimeout
in interfacejavax.websocket.WebSocketContainer
- Overrides:
setDefaultMaxSessionIdleTimeout
in classClientContainer
-
setDefaultMaxTextMessageBufferSize
public void setDefaultMaxTextMessageBufferSize(int max)
- Specified by:
setDefaultMaxTextMessageBufferSize
in interfacejavax.websocket.WebSocketContainer
- Overrides:
setDefaultMaxTextMessageBufferSize
in classClientContainer
-
-