public class WsServerContainer extends WsWebSocketContainer implements ServerContainer
IO_TIMEOUT_MS_DEFAULT, IO_TIMEOUT_MS_PROPERTY, SSL_CONTEXT_PROPERTY, SSL_PROTOCOLS_PROPERTY, SSL_TRUSTSTORE_PROPERTY, SSL_TRUSTSTORE_PWD_DEFAULT, SSL_TRUSTSTORE_PWD_PROPERTY
Modifier and Type | Method and Description |
---|---|
void |
addEndpoint(java.lang.Class<?> pojo)
Provides the equivalent of
addEndpoint(ServerEndpointConfig)
for publishing plain old java objects (POJOs) that have been annotated as
WebSocket endpoints. |
void |
addEndpoint(ServerEndpointConfig sec)
Published the provided endpoint implementation at the specified path with
the specified configuration.
|
void |
closeAuthenticatedSession(java.lang.String httpSessionId) |
void |
destroy()
Cleans up the resources still in use by WebSocket sessions created from
this container.
|
void |
doUpgrade(HttpServletRequest request,
HttpServletResponse response,
ServerEndpointConfig sec,
java.util.Map<java.lang.String,java.lang.String> pathParams)
Until the WebSocket specification provides such a mechanism, this Tomcat
proprietary method is provided to enable applications to programmatically
determine whether or not to upgrade an individual request to WebSocket.
|
org.apache.tomcat.websocket.server.WsMappingResult |
findMapping(java.lang.String path) |
protected WsWriteTimeout |
getTimeout() |
boolean |
isEnforceNoAddAfterHandshake() |
protected void |
registerSession(Endpoint endpoint,
WsSession wsSession)
Overridden to make it visible to other classes in this package.
|
void |
setEnforceNoAddAfterHandshake(boolean enforceNoAddAfterHandshake) |
protected void |
unregisterSession(Endpoint endpoint,
WsSession wsSession)
Overridden to make it visible to other classes in this package.
|
backgroundProcess, connectToServer, connectToServer, connectToServer, connectToServer, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getInstalledExtensions, getProcessPeriod, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize, setInstanceManager, setProcessPeriod
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToServer, connectToServer, connectToServer, connectToServer, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getInstalledExtensions, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
public void addEndpoint(ServerEndpointConfig sec) throws DeploymentException
WsServerContainer(ServletContext)
must be called before calling this method.addEndpoint
in interface ServerContainer
sec
- The configuration to use when creating endpoint instancesDeploymentException
- if the endpoint can not be published as
requestedpublic void addEndpoint(java.lang.Class<?> pojo) throws DeploymentException
addEndpoint(ServerEndpointConfig)
for publishing plain old java objects (POJOs) that have been annotated as
WebSocket endpoints.addEndpoint
in interface ServerContainer
pojo
- The annotated POJODeploymentException
public void destroy()
WsWebSocketContainer
Future
s associated with blocking read/writes.destroy
in class WsWebSocketContainer
public void doUpgrade(HttpServletRequest request, HttpServletResponse response, ServerEndpointConfig sec, java.util.Map<java.lang.String,java.lang.String> pathParams) throws ServletException, java.io.IOException
Note: This method is not used by Tomcat but is used directly by third-party code and must not be removed.
request
- The request object to be upgradedresponse
- The response object to be populated with the result of
the upgradesec
- The server endpoint to use to process the upgrade requestpathParams
- The path parameters associated with the upgrade requestServletException
- If a configuration error prevents the upgrade
from taking placejava.io.IOException
- If an I/O error occurs during the upgrade processpublic org.apache.tomcat.websocket.server.WsMappingResult findMapping(java.lang.String path)
public boolean isEnforceNoAddAfterHandshake()
public void setEnforceNoAddAfterHandshake(boolean enforceNoAddAfterHandshake)
protected WsWriteTimeout getTimeout()
protected void registerSession(Endpoint endpoint, WsSession wsSession)
registerSession
in class WsWebSocketContainer
protected void unregisterSession(Endpoint endpoint, WsSession wsSession)
unregisterSession
in class WsWebSocketContainer
public void closeAuthenticatedSession(java.lang.String httpSessionId)
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.