Top Description Fields Constructors Methods
org.glassfish.tyrus.server

public abstract Class TyrusServerContainer

extends BaseContainer
implements ServerContainer
Class Inheritance
All Implemented Interfaces
org.glassfish.tyrus.spi.ServerContainer, jakarta.websocket.server.ServerContainer, jakarta.websocket.WebSocketContainer
Imports
java.io.IOException, java.net.URI, java.util.Collections, .HashSet, .Map, .Set, java.util.concurrent.Future, jakarta.websocket.ClientEndpointConfig, .DeploymentException, .Endpoint, .Extension, .Session, jakarta.websocket.server.ServerApplicationConfig, .ServerEndpointConfig, org.glassfish.tyrus.client.ClientManager, org.glassfish.tyrus.core.BaseContainer, .ErrorCollector, org.glassfish.tyrus.spi.ServerContainer

Server Container Implementation.
Authors
Martin Matula, Pavel Bucek, Stepan Kopriva

Field Summary

Modifier and TypeField and Description
private final Set<Class<?>>
private ClientManager
private final ErrorCollector
private long
private long
private final Set<Class<?>>
private final Set<ServerEndpointConfig>
private int
private int
private boolean
private volatile int
private final ServerApplicationConfig

Constructor Summary

AccessConstructor and Description
public
TyrusServerContainer(Set<Class<?>>
classes to be included in this application instance. Can contain any combination of annotated endpoints (see jakarta.websocket.server.ServerEndpoint) or jakarta.websocket.Endpoint descendants.
classes
)

Create new TyrusServerContainer.

public
TyrusServerContainer(ServerApplicationConfig
provided application config.
serverApplicationConfig
)

Create new TyrusServerContainer using already created ServerApplicationConfig instance.

Method Summary

Modifier and TypeMethod and Description
public void
addEndpoint(Class<?>
the class of the annotated endpoint
endpointClass
)

Implements jakarta.websocket.server.ServerContainer.addEndpoint.

Deploys the given annotated endpoint into this ServerContainer.

public void
addEndpoint(ServerEndpointConfig
the configuration instance representing the logical endpoint that will be registered.
serverEndpointConfig
)

Implements jakarta.websocket.server.ServerContainer.addEndpoint.

Deploys the given endpoint described by the provided configuration into this ServerContainer.

public Future<Session>

Returns:

Future for the Session created if the connection is successful.
asyncConnectToServer
(Class<?>
the annotated websocket client endpoint.
annotatedEndpointClass
,
URI
the complete path to the server endpoint.
path
)

Non-blocking version of jakarta.websocket.WebSocketContainer#connectToServer(Class, java.net.URI).

public Future<Session>

Returns:

the Session created if the connection is successful.
asyncConnectToServer
(Class<? extends Endpoint>
the programmatic client endpoint class Endpoint.
endpointClass
,
ClientEndpointConfig
the configuration used to configure the programmatic endpoint.
cec
,
URI
the complete path to the server endpoint.
path
)

Non-blocking version of jakarta.websocket.WebSocketContainer#connectToServer(Class, jakarta.websocket.ClientEndpointConfig, java.net.URI).

public Future<Session>

Returns:

the Session created if the connection is successful.
asyncConnectToServer
(Endpoint
the programmatic client endpoint instance Endpoint.
endpointInstance
,
ClientEndpointConfig
the configuration used to configure the programmatic endpoint.
cec
,
URI
the complete path to the server endpoint.
path
)

Non-blocking version of jakarta.websocket.WebSocketContainer#connectToServer(jakarta.websocket.Endpoint, jakarta.websocket.ClientEndpointConfig, java.net.URI).

public Future<Session>

Returns:

the Session created if the connection is successful.
asyncConnectToServer
(Object
the annotated websocket client endpoint instance.
obj
,
URI
the complete path to the server endpoint.
path
)

Non-blocking version of jakarta.websocket.WebSocketContainer#connectToServer(Object, java.net.URI).

public Session
connectToServer(Class<T>
the annotated websocket client endpoint.
annotatedEndpointClass
,
URI
the complete path to the server endpoint.
path
)

Implements jakarta.websocket.WebSocketContainer.connectToServer.

Connect the supplied annotated endpoint to its server.

public Session
connectToServer(Class<? extends Endpoint>
the programmatic client endpoint class Endpoint.
endpointClass
,
ClientEndpointConfig
the configuration used to configure the programmatic endpoint.
cec
,
URI
the complete path to the server endpoint.
path
)

Implements jakarta.websocket.WebSocketContainer.connectToServer.

Connect the supplied programmatic endpoint to its server with the given configuration.

public Session
connectToServer(Object
the annotated websocket client endpoint instance.
annotatedEndpointInstance
,
URI
the complete path to the server endpoint.
path
)

Implements jakarta.websocket.WebSocketContainer.connectToServer.

Connect the supplied annotated endpoint instance to its server.

public Session
connectToServer(Endpoint
the programmatic client endpoint instance Endpoint.
endpointInstance
,
ClientEndpointConfig
the configuration used to configure the programmatic endpoint.
cec
,
URI
the complete path to the server endpoint.
path
)

Implements jakarta.websocket.WebSocketContainer.connectToServer.

Connect the supplied programmatic client endpoint instance to its server with the given configuration.

public void
protected synchronized ClientManager

Returns:

ClientManager associated with this server container.
getClientManager
()

Can be overridden to provide own ClientManager implementation or instance.

public long
getDefaultAsyncSendTimeout()

Implements jakarta.websocket.WebSocketContainer.getDefaultAsyncSendTimeout.

Return the number of milliseconds the implementation will timeout attempting to send a websocket message for all RemoteEndpoints associated with this container.

public int
getDefaultMaxBinaryMessageBufferSize()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxBinaryMessageBufferSize.

Returns the default maximum size of incoming binary message that this container will buffer.

public long
getDefaultMaxSessionIdleTimeout()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxSessionIdleTimeout.

Return the default time in milliseconds after which any web socket sessions in this container will be closed if it has been inactive.

public int
getDefaultMaxTextMessageBufferSize()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxTextMessageBufferSize.

Returns the default maximum size of incoming text message that this container will buffer.

public Set<Extension>
getInstalledExtensions()

Implements jakarta.websocket.WebSocketContainer.getInstalledExtensions.

Return the set of Extensions installed in the container.

public int

Returns:

the port of the started container or -1, when the container is not started or the container does not provide the port.
getPort
()

Get port of the started container.

public abstract void
register(Class<?> endpointClass)

public abstract void
register(ServerEndpointConfig serverEndpointConfig)

public void
setAsyncSendTimeout(long
the timeout in milliseconds; use zero or negative value for no timeout
timeoutmillis
)

Implements jakarta.websocket.WebSocketContainer.setAsyncSendTimeout.

Sets the number of milliseconds the implementation will timeout attempting to send a websocket message for all RemoteEndpoints associated with this container.

public void
setDefaultMaxBinaryMessageBufferSize(int
the maximum size of binary message in number of bytes.
max
)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxBinaryMessageBufferSize.

Sets the default maximum size of incoming binary message that this container will buffer.

public void
setDefaultMaxSessionIdleTimeout(long
the maximum time in milliseconds; use zero or negative value for no timeout
defaultMaxSessionIdleTimeout
)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxSessionIdleTimeout.

Sets the default time in milliseconds after which any web socket sessions in this container will be closed if it has been inactive.

public void
setDefaultMaxTextMessageBufferSize(int
the maximum size of text message in number of bytes.
max
)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxTextMessageBufferSize.

Sets the maximum size of incoming text message that this container will buffer.

public void
start(String
context path of the deployed websocket application.
rootPath
,
int
TCP port
port
)

Implements org.glassfish.tyrus.spi.ServerContainer.start.

Start the container.

public void
stop()

Implements org.glassfish.tyrus.spi.ServerContainer.stop.

Undeploy all endpoints and stop underlying org.glassfish.tyrus.spi.ServerContainer.

public void
upgradeHttpToWebSocket(Object
The HttpServletRequest to be processed as a WebSocket handshake as per section 4.0 of RFC 6455.
httpServletRequest
,
Object
The HttpServletResponse to be used when processing the httpServletRequest as a WebSocket handshake as per section 4.0 of RFC 6455.
httpServletResponse
,
ServerEndpointConfig
The server endpoint configuration to use to configure the WebSocket endpoint
sec
,
Map<String, String>
Provides a mapping of path parameter names and values, if any, to be used for the WebSocket connection established by the call to this method. If no such mapping is defined, an empty Map must be passed.
pathParameters
)

Implements jakarta.websocket.server.ServerContainer.upgradeHttpToWebSocket.

Upgrade the HTTP connection represented by the HttpServletRequest and HttpServletResponse to the WebSocket protocol and establish a WebSocket connection as per the provided ServerEndpointConfig.

Inherited from org.glassfish.tyrus.core.BaseContainer:
getExecutorServicegetScheduledExecutorServiceshutdownshutdown

Field Detail

classesback to summary
private final Set<Class<?>> classes
clientManagerback to summary
private ClientManager clientManager
collectorback to summary
private final ErrorCollector collector
defaultAsyncSendTimeoutback to summary
private long defaultAsyncSendTimeout
defaultMaxSessionIdleTimeoutback to summary
private long defaultMaxSessionIdleTimeout
dynamicallyAddedClassesback to summary
private final Set<Class<?>> dynamicallyAddedClasses
dynamicallyAddedEndpointConfigsback to summary
private final Set<ServerEndpointConfig> dynamicallyAddedEndpointConfigs
maxBinaryMessageBufferSizeback to summary
private int maxBinaryMessageBufferSize
maxTextMessageBufferSizeback to summary
private int maxTextMessageBufferSize
notYetStartedback to summary
private boolean notYetStarted
portback to summary
private volatile int port
serverApplicationConfigback to summary
private final ServerApplicationConfig serverApplicationConfig

Constructor Detail

TyrusServerContainerback to summary
public TyrusServerContainer(Set<Class<?>> classes)

Create new TyrusServerContainer.

Parameters
classes:Set<Class<?>>

classes to be included in this application instance. Can contain any combination of annotated endpoints (see jakarta.websocket.server.ServerEndpoint) or jakarta.websocket.Endpoint descendants.

TyrusServerContainerback to summary
public TyrusServerContainer(ServerApplicationConfig serverApplicationConfig)

Create new TyrusServerContainer using already created ServerApplicationConfig instance.

Parameters
serverApplicationConfig:ServerApplicationConfig

provided application config.

Method Detail

addEndpointback to summary
public void addEndpoint(Class<?> endpointClass) throws DeploymentException

Implements jakarta.websocket.server.ServerContainer.addEndpoint.

Doc from jakarta.websocket.server.ServerContainer.addEndpoint.

Deploys the given annotated endpoint into this ServerContainer.

Parameters
endpointClass:Class<?>

the class of the annotated endpoint

Annotations
@Override
Exceptions
DeploymentException:
if the annotated endpoint was badly formed.
addEndpointback to summary
public void addEndpoint(ServerEndpointConfig serverEndpointConfig) throws DeploymentException

Implements jakarta.websocket.server.ServerContainer.addEndpoint.

Doc from jakarta.websocket.server.ServerContainer.addEndpoint.

Deploys the given endpoint described by the provided configuration into this ServerContainer.

Parameters
serverEndpointConfig:ServerEndpointConfig

the configuration instance representing the logical endpoint that will be registered.

Annotations
@Override
Exceptions
DeploymentException:
if the endpoint was badly formed.
asyncConnectToServerback to summary
public Future<Session> asyncConnectToServer(Class<?> annotatedEndpointClass, URI path) throws DeploymentException

Non-blocking version of jakarta.websocket.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.

Parameters
annotatedEndpointClass:Class<?>

the annotated websocket client endpoint.

path:URI

the complete path to the server endpoint.

Returns:Future<Session>

Future for the Session created if the connection is successful.

Exceptions
DeploymentException:
if the class is not a valid annotated endpoint class.
asyncConnectToServerback to summary
public Future<Session> asyncConnectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException

Non-blocking version of jakarta.websocket.WebSocketContainer#connectToServer(Class, jakarta.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.

Parameters
endpointClass:Class<? extends Endpoint>

the programmatic client endpoint class Endpoint.

cec:ClientEndpointConfig

the configuration used to configure the programmatic endpoint.

path:URI

the complete path to the server endpoint.

Returns:Future<Session>

the Session created if the connection is successful.

Exceptions
DeploymentException:
if the configuration is not valid
See Also
jakarta.websocket.WebSocketContainer#connectToServer(Class, jakarta.websocket.ClientEndpointConfig, java.net.URI)
asyncConnectToServerback to summary
public Future<Session> asyncConnectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException

Non-blocking version of jakarta.websocket.WebSocketContainer#connectToServer(jakarta.websocket.Endpoint, jakarta.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.

Parameters
endpointInstance:Endpoint

the programmatic client endpoint instance Endpoint.

cec:ClientEndpointConfig

the configuration used to configure the programmatic endpoint.

path:URI

the complete path to the server endpoint.

Returns:Future<Session>

the Session created if the connection is successful.

Exceptions
DeploymentException:
if the configuration is not valid
See Also
jakarta.websocket.WebSocketContainer#connectToServer(jakarta.websocket.Endpoint, jakarta.websocket.ClientEndpointConfig, java.net.URI)
asyncConnectToServerback to summary
public Future<Session> asyncConnectToServer(Object obj, URI path) throws DeploymentException

Non-blocking version of jakarta.websocket.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.

Parameters
obj:Object

the annotated websocket client endpoint instance.

path:URI

the complete path to the server endpoint.

Returns:Future<Session>

the Session created if the connection is successful.

Exceptions
DeploymentException:
if the annotated endpoint instance is not valid.
See Also
jakarta.websocket.WebSocketContainer#connectToServer(Object, java.net.URI)
connectToServerback to summary
public Session connectToServer(Class<T> annotatedEndpointClass, URI path) throws DeploymentException, IOException

Implements jakarta.websocket.WebSocketContainer.connectToServer.

Doc from jakarta.websocket.WebSocketContainer.connectToServer.

Connect the supplied annotated endpoint to its server. The supplied object must be a class decorated with the class level jakarta.websocket.ClientEndpoint annotation. This method blocks until the connection is established, or throws an error if either the connection could not be made or there was a problem with the supplied endpoint class.

Parameters
annotatedEndpointClass:Class<T>

the annotated websocket client endpoint.

path:URI

the complete path to the server endpoint.

Returns:Session

the Session created if the connection is successful.

Annotations
@Override
Exceptions
DeploymentException:
if the class is not a valid annotated endpoint class.
IOException:
if there was a network or protocol problem that prevented the client endpoint being connected to its server.
connectToServerback to summary
public Session connectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException

Implements jakarta.websocket.WebSocketContainer.connectToServer.

Doc from jakarta.websocket.WebSocketContainer.connectToServer.

Connect the supplied programmatic endpoint to its server with the given configuration. This method blocks until the connection is established, or throws an error if the connection could not be made.

Parameters
endpointClass:Class<? extends Endpoint>

the programmatic client endpoint class Endpoint.

cec:ClientEndpointConfig

the configuration used to configure the programmatic endpoint.

path:URI

the complete path to the server endpoint.

Returns:Session

the Session created if the connection is successful.

Annotations
@Override
Exceptions
DeploymentException:
if the configuration is not valid
IOException:
if there was a network or protocol problem that prevented the client endpoint being connected to its server
connectToServerback to summary
public Session connectToServer(Object annotatedEndpointInstance, URI path) throws DeploymentException, IOException

Implements jakarta.websocket.WebSocketContainer.connectToServer.

Doc from jakarta.websocket.WebSocketContainer.connectToServer.

Connect the supplied annotated endpoint instance to its server. The supplied object must be a class decorated with the class level jakarta.websocket.ClientEndpoint annotation. This method blocks until the connection is established, or throws an error if either the connection could not be made or there was a problem with the supplied endpoint class. If the developer uses this method to deploy the client endpoint, services like dependency injection that are supported, for example, when the implementation is part of the Java EE platform may not be available. If the client endpoint uses dependency injection, use WebSocketContainer#connectToServer(java.lang.Class, java.net.URI) instead.

Parameters
annotatedEndpointInstance:Object

the annotated websocket client endpoint instance.

path:URI

the complete path to the server endpoint.

Returns:Session

the Session created if the connection is successful.

Annotations
@Override
Exceptions
DeploymentException:
if the annotated endpoint instance is not valid.
IOException:
if there was a network or protocol problem that prevented the client endpoint being connected to its server.
connectToServerback to summary
public Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException

Implements jakarta.websocket.WebSocketContainer.connectToServer.

Doc from jakarta.websocket.WebSocketContainer.connectToServer.

Connect the supplied programmatic client endpoint instance to its server with the given configuration. This method blocks until the connection is established, or throws an error if the connection could not be made. If the developer uses this method to deploy the client endpoint, services like dependency injection that are supported, for example, when the implementation is part of the Java EE platform may not be available. If the client endpoint uses dependency injection, use WebSocketContainer#connectToServer(java.lang.Class, jakarta.websocket.ClientEndpointConfig, java.net.URI) instead.

Parameters
endpointInstance:Endpoint

the programmatic client endpoint instance Endpoint.

cec:ClientEndpointConfig

the configuration used to configure the programmatic endpoint.

path:URI

the complete path to the server endpoint.

Returns:Session

the Session created if the connection is successful.

Annotations
@Override
Exceptions
DeploymentException:
if the configuration is not valid
IOException:
if there was a network or protocol problem that prevented the client endpoint being connected to its server
doneDeploymentback to summary
public void doneDeployment()

Container is no longer required to accept addEndpoint(jakarta.websocket.server.ServerEndpointConfig) and addEndpoint(Class) calls.

getClientManagerback to summary
protected synchronized ClientManager getClientManager()

Can be overridden to provide own ClientManager implementation or instance.

Returns:ClientManager

ClientManager associated with this server container.

getDefaultAsyncSendTimeoutback to summary
public long getDefaultAsyncSendTimeout()

Implements jakarta.websocket.WebSocketContainer.getDefaultAsyncSendTimeout.

Doc from jakarta.websocket.WebSocketContainer.getDefaultAsyncSendTimeout.

Return the number of milliseconds the implementation will timeout attempting to send a websocket message for all RemoteEndpoints associated with this container. A zero or negative value indicates the implementation will not timeout attempting to send a websocket message asynchronously. Note this default may be overridden in each RemoteEndpoint.

Returns:long

the timeout time in milliseconds.

Annotations
@Override
getDefaultMaxBinaryMessageBufferSizeback to summary
public int getDefaultMaxBinaryMessageBufferSize()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxBinaryMessageBufferSize.

Doc from jakarta.websocket.WebSocketContainer.getDefaultMaxBinaryMessageBufferSize.

Returns the default maximum size of incoming binary message that this container will buffer. This default may be overridden on a per session basis using Session#setMaxBinaryMessageBufferSize(int)

Returns:int

the maximum size of incoming binary message in number of bytes.

Annotations
@Override
getDefaultMaxSessionIdleTimeoutback to summary
public long getDefaultMaxSessionIdleTimeout()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxSessionIdleTimeout.

Doc from jakarta.websocket.WebSocketContainer.getDefaultMaxSessionIdleTimeout.

Return the default time in milliseconds after which any web socket sessions in this container will be closed if it has been inactive. A value that is zero or negative indicates the sessions will never timeout due to inactivity. The value may be overridden on a per session basis using Session#setMaxIdleTimeout(long)

Returns:long

the default number of milliseconds after which an idle session in this container will be closed

Annotations
@Override
getDefaultMaxTextMessageBufferSizeback to summary
public int getDefaultMaxTextMessageBufferSize()

Implements jakarta.websocket.WebSocketContainer.getDefaultMaxTextMessageBufferSize.

Doc from jakarta.websocket.WebSocketContainer.getDefaultMaxTextMessageBufferSize.

Returns the default maximum size of incoming text message that this container will buffer. This default may be overridden on a per session basis using Session#setMaxTextMessageBufferSize(int)

Returns:int

the maximum size of incoming text message in number of bytes.

Annotations
@Override
getInstalledExtensionsback to summary
public Set<Extension> getInstalledExtensions()

Implements jakarta.websocket.WebSocketContainer.getInstalledExtensions.

Doc from jakarta.websocket.WebSocketContainer.getInstalledExtensions.

Return the set of Extensions installed in the container.

Returns:Set<Extension>

the set of extensions.

Annotations
@Override
getPortback to summary
public int getPort()

Get port of the started container.

Returns:int

the port of the started container or -1, when the container is not started or the container does not provide the port.

registerback to summary
public abstract void register(Class<?> endpointClass) throws DeploymentException
registerback to summary
public abstract void register(ServerEndpointConfig serverEndpointConfig) throws DeploymentException
setAsyncSendTimeoutback to summary
public void setAsyncSendTimeout(long timeoutmillis)

Implements jakarta.websocket.WebSocketContainer.setAsyncSendTimeout.

Doc from jakarta.websocket.WebSocketContainer.setAsyncSendTimeout.

Sets the number of milliseconds the implementation will timeout attempting to send a websocket message for all RemoteEndpoints associated with this container. A zero or negative value indicates the implementation will not timeout attempting to send a websocket message asynchronously. Note this default may be overridden in each RemoteEndpoint.

Parameters
timeoutmillis:long

the timeout in milliseconds; use zero or negative value for no timeout

Annotations
@Override
setDefaultMaxBinaryMessageBufferSizeback to summary
public void setDefaultMaxBinaryMessageBufferSize(int max)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxBinaryMessageBufferSize.

Doc from jakarta.websocket.WebSocketContainer.setDefaultMaxBinaryMessageBufferSize.

Sets the default maximum size of incoming binary message that this container will buffer.

Parameters
max:int

the maximum size of binary message in number of bytes.

Annotations
@Override
setDefaultMaxSessionIdleTimeoutback to summary
public void setDefaultMaxSessionIdleTimeout(long defaultMaxSessionIdleTimeout)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxSessionIdleTimeout.

Doc from jakarta.websocket.WebSocketContainer.setDefaultMaxSessionIdleTimeout.

Sets the default time in milliseconds after which any web socket sessions in this container will be closed if it has been inactive. A value that is zero or negative indicates the sessions will never timeout due to inactivity. The value may be overridden on a per session basis using Session#setMaxIdleTimeout(long)

Parameters
defaultMaxSessionIdleTimeout:long

the maximum time in milliseconds; use zero or negative value for no timeout

Annotations
@Override
setDefaultMaxTextMessageBufferSizeback to summary
public void setDefaultMaxTextMessageBufferSize(int max)

Implements jakarta.websocket.WebSocketContainer.setDefaultMaxTextMessageBufferSize.

Doc from jakarta.websocket.WebSocketContainer.setDefaultMaxTextMessageBufferSize.

Sets the maximum size of incoming text message that this container will buffer.

Parameters
max:int

the maximum size of text message in number of bytes.

Annotations
@Override
startback to summary
public void start(String rootPath, int port) throws IOException, DeploymentException

Implements org.glassfish.tyrus.spi.ServerContainer.start.

Start the container.

Parameters
rootPath:String

context path of the deployed websocket application.

port:int

Doc from org.glassfish.tyrus.spi.ServerContainer.start.

TCP port

Annotations
@Override
Exceptions
IOException:
when any IO related issues emerge during org.glassfish.tyrus.spi.ServerContainer#start(String, int).
DeploymentException:
when any deployment related error is found; should contain list of all found issues.
stopback to summary
public void stop()

Implements org.glassfish.tyrus.spi.ServerContainer.stop.

Undeploy all endpoints and stop underlying org.glassfish.tyrus.spi.ServerContainer.

Release all created threadpools / executor services.

Annotations
@Override
upgradeHttpToWebSocketback to summary
public void upgradeHttpToWebSocket(Object httpServletRequest, Object httpServletResponse, ServerEndpointConfig sec, Map<String, String> pathParameters) throws IOException, DeploymentException

Implements jakarta.websocket.server.ServerContainer.upgradeHttpToWebSocket.

Doc from jakarta.websocket.server.ServerContainer.upgradeHttpToWebSocket.

Upgrade the HTTP connection represented by the HttpServletRequest and HttpServletResponse to the WebSocket protocol and establish a WebSocket connection as per the provided ServerEndpointConfig.

This method is primarily intended to be used by frameworks that implement the front-controller pattern. It does not deploy the provided endpoint.

If the WebSocket implementation is not deployed as part of a Jakarta Servlet container, this method will throw an UnsupportedOperationException.

Parameters
httpServletRequest:Object

The HttpServletRequest to be processed as a WebSocket handshake as per section 4.0 of RFC 6455.

httpServletResponse:Object

The HttpServletResponse to be used when processing the httpServletRequest as a WebSocket handshake as per section 4.0 of RFC 6455.

sec:ServerEndpointConfig

The server endpoint configuration to use to configure the WebSocket endpoint

pathParameters:Map<String, String>

Provides a mapping of path parameter names and values, if any, to be used for the WebSocket connection established by the call to this method. If no such mapping is defined, an empty Map must be passed.

Exceptions
IOException:
if an I/O error occurs during the establishment of a WebSocket connection
DeploymentException:
if a configuration error prevents the establishment of a WebSocket connection