public abstract class TyrusServerContainer
extends org.glassfish.tyrus.core.BaseContainer
implements org.glassfish.tyrus.spi.ServerContainer
| Constructor and Description |
|---|
TyrusServerContainer(ServerApplicationConfig serverApplicationConfig)
Create new
TyrusServerContainer using already created ServerApplicationConfig instance. |
TyrusServerContainer(Set<Class<?>> classes)
Create new
TyrusServerContainer. |
getExecutorService, getScheduledExecutorService, shutdown, shutdownpublic TyrusServerContainer(Set<Class<?>> classes)
TyrusServerContainer.classes - classes to be included in this application instance. Can contain any combination of annotated
endpoints (see ServerEndpoint) or Endpoint descendants.public TyrusServerContainer(ServerApplicationConfig serverApplicationConfig)
TyrusServerContainer using already created ServerApplicationConfig instance.serverApplicationConfig - provided application config.public void start(String rootPath, int port) throws IOException, DeploymentException
IOException - when any IO related issues emerge during ServerContainer.start(String, int).DeploymentException - when any deployment related error is found; should contain list of all found issues.public void stop()
ServerContainer.
Release all created threadpools / executor services.public abstract void register(Class<?> endpointClass) throws DeploymentException
DeploymentExceptionpublic abstract void register(ServerEndpointConfig serverEndpointConfig) throws DeploymentException
DeploymentExceptionpublic void addEndpoint(Class<?> endpointClass) throws DeploymentException
addEndpoint in interface ServerContainerDeploymentExceptionpublic void addEndpoint(ServerEndpointConfig serverEndpointConfig) throws DeploymentException
addEndpoint in interface ServerContainerDeploymentExceptionprotected org.glassfish.tyrus.client.ClientManager getClientManager()
ClientManager implementation or instance.ClientManager associated with this server container.public Session connectToServer(Class annotatedEndpointClass, URI path) throws DeploymentException, IOException
connectToServer in interface WebSocketContainerDeploymentExceptionIOExceptionpublic Session connectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException
connectToServer in interface WebSocketContainerDeploymentExceptionIOExceptionpublic Session connectToServer(Object annotatedEndpointInstance, URI path) throws DeploymentException, IOException
connectToServer in interface WebSocketContainerDeploymentExceptionIOExceptionpublic Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException
connectToServer in interface WebSocketContainerDeploymentExceptionIOExceptionpublic Future<Session> asyncConnectToServer(Class<?> annotatedEndpointClass, URI path) throws DeploymentException
WebSocketContainer.connectToServer(Class, java.net.URI).
Only simple checks are performed in the main thread; client container is created in different thread, same
applies to connecting etc.annotatedEndpointClass - the annotated websocket client endpoint.path - the complete path to the server endpoint.DeploymentException - if the class is not a valid annotated endpoint class.public Future<Session> asyncConnectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException
WebSocketContainer.connectToServer(Class, javax.websocket.ClientEndpointConfig, java.net.URI).
Only simple checks are performed in the main thread; client container is created in different thread, same
applies to connecting etc.endpointClass - the programmatic client endpoint class Endpoint.path - the complete path to the server endpoint.cec - the configuration used to configure the programmatic endpoint.DeploymentException - if the configuration is not validWebSocketContainer.connectToServer(Class, javax.websocket.ClientEndpointConfig, java.net.URI)public Future<Session> asyncConnectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException
WebSocketContainer.connectToServer(javax.websocket.Endpoint, javax.websocket.ClientEndpointConfig, java.net.URI).
Only simple checks are performed in the main thread; client container is created in different thread, same
applies to connecting etc.endpointInstance - the programmatic client endpoint instance Endpoint.path - the complete path to the server endpoint.cec - the configuration used to configure the programmatic endpoint.DeploymentException - if the configuration is not validWebSocketContainer.connectToServer(javax.websocket.Endpoint, javax.websocket.ClientEndpointConfig, java.net.URI)public Future<Session> asyncConnectToServer(Object obj, URI path) throws DeploymentException
WebSocketContainer.connectToServer(Object, java.net.URI).
Only simple checks are performed in the main thread; client container is created in different thread, same
applies to connecting etc.obj - the annotated websocket client endpoint
instance.path - the complete path to the server endpoint.DeploymentException - if the annotated endpoint instance is not valid.WebSocketContainer.connectToServer(Object, java.net.URI)public int getDefaultMaxBinaryMessageBufferSize()
getDefaultMaxBinaryMessageBufferSize in interface WebSocketContainerpublic void setDefaultMaxBinaryMessageBufferSize(int max)
setDefaultMaxBinaryMessageBufferSize in interface WebSocketContainerpublic int getDefaultMaxTextMessageBufferSize()
getDefaultMaxTextMessageBufferSize in interface WebSocketContainerpublic void setDefaultMaxTextMessageBufferSize(int max)
setDefaultMaxTextMessageBufferSize in interface WebSocketContainerpublic Set<Extension> getInstalledExtensions()
getInstalledExtensions in interface WebSocketContainerpublic long getDefaultAsyncSendTimeout()
getDefaultAsyncSendTimeout in interface WebSocketContainerpublic void setAsyncSendTimeout(long timeoutmillis)
setAsyncSendTimeout in interface WebSocketContainerpublic long getDefaultMaxSessionIdleTimeout()
getDefaultMaxSessionIdleTimeout in interface WebSocketContainerpublic void setDefaultMaxSessionIdleTimeout(long defaultMaxSessionIdleTimeout)
setDefaultMaxSessionIdleTimeout in interface WebSocketContainerpublic void doneDeployment()
addEndpoint(javax.websocket.server.ServerEndpointConfig) and
addEndpoint(Class) calls.Copyright © 2012-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.