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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a container-managedExecutorServiceregistered underjava:comp/DefaultManagedExecutorServiceor if the lookup has failed, it returns aExecutorServicecreated and managed by this instance ofBaseContainer.Returns a container-managedScheduledExecutorServiceregistered underjava:comp/DefaultManagedScheduledExecutorServiceor if the lookup has failed it returns aScheduledExecutorServicecreated and managed by this instance ofBaseContainer.voidshutdown()Release executor services managed by this instance.protected voidshutdown(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, waitMethods 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-managedExecutorServiceregistered underjava:comp/DefaultManagedExecutorServiceor if the lookup has failed, it returns aExecutorServicecreated and managed by this instance ofBaseContainer.- Specified by:
getExecutorServicein classExecutorServiceProvider- Returns:
- executor service.
-
getScheduledExecutorService
Returns a container-managedScheduledExecutorServiceregistered underjava:comp/DefaultManagedScheduledExecutorServiceor if the lookup has failed it returns aScheduledExecutorServicecreated and managed by this instance ofBaseContainer.- Specified by:
getScheduledExecutorServicein 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.
-