Package org.glassfish.tyrus.core
Class BaseContainer
java.lang.Object
org.glassfish.tyrus.core.ExecutorServiceProvider
org.glassfish.tyrus.core.BaseContainer
- All Implemented Interfaces:
WebSocketContainer
- Direct Known Subclasses:
ClientManager
,TyrusServerContainer
Base WebSocket container.
Client and Server containers extend this to provide additional functionality.
- Author:
- Jitendra Kotamraju
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a container-managedExecutorService
registered underjava:comp/DefaultManagedExecutorService
or if the lookup has failed, it returns aExecutorService
created and managed by this instance ofBaseContainer
.Returns a container-managedScheduledExecutorService
registered underjava:comp/DefaultManagedScheduledExecutorService
or if the lookup has failed it returns aScheduledExecutorService
created and managed by this instance ofBaseContainer
.void
shutdown()
Release executor services managed by this instance.protected void
shutdown
(BaseContainer.ShutDownCondition shutDownCondition) Release executor services managed by this instance if the condition passed in the parameter is fulfilled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.websocket.WebSocketContainer
connectToServer, connectToServer, connectToServer, connectToServer, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getInstalledExtensions, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
-
Constructor Details
-
BaseContainer
public BaseContainer()
-
-
Method Details
-
getExecutorService
Returns a container-managedExecutorService
registered underjava:comp/DefaultManagedExecutorService
or if the lookup has failed, it returns aExecutorService
created and managed by this instance ofBaseContainer
.- Specified by:
getExecutorService
in classExecutorServiceProvider
- Returns:
- executor service.
-
getScheduledExecutorService
Returns a container-managedScheduledExecutorService
registered underjava:comp/DefaultManagedScheduledExecutorService
or if the lookup has failed it returns aScheduledExecutorService
created and managed by this instance ofBaseContainer
.- Specified by:
getScheduledExecutorService
in classExecutorServiceProvider
- Returns:
- scheduled executor service.
-
shutdown
public void shutdown()Release executor services managed by this instance. Executor services obtained via JNDI lookup won't be shut down. -
shutdown
Release executor services managed by this instance if the condition passed in the parameter is fulfilled. Executor services obtained via JNDI lookup won't be shut down.- Parameters:
shutDownCondition
- condition that will be evaluated before executor services are released and they will be released only if the condition is evaluated totrue
. The condition will be evaluated in a synchronized block in order to make the process of its evaluation and executor services release an atomic operation.
-