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
public abstract class BaseContainer extends ExecutorServiceProvider implements WebSocketContainer
Base WebSocket container.Client and Server containers extend this to provide additional functionality.
- Author:
- Jitendra Kotamraju
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceBaseContainer.ShutDownCondition
-
Constructor Summary
Constructors Constructor Description BaseContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.ExecutorServicegetExecutorService()Returns a container-managedExecutorServiceregistered underjava:comp/DefaultManagedExecutorServiceor if the lookup has failed, it returns aExecutorServicecreated and managed by this instance ofBaseContainer.java.util.concurrent.ScheduledExecutorServicegetScheduledExecutorService()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, wait
-
Methods inherited from interface jakarta.websocket.WebSocketContainer
connectToServer, connectToServer, connectToServer, connectToServer, getDefaultAsyncSendTimeout, getDefaultMaxBinaryMessageBufferSize, getDefaultMaxSessionIdleTimeout, getDefaultMaxTextMessageBufferSize, getInstalledExtensions, setAsyncSendTimeout, setDefaultMaxBinaryMessageBufferSize, setDefaultMaxSessionIdleTimeout, setDefaultMaxTextMessageBufferSize
-
-
-
-
Method Detail
-
getExecutorService
public java.util.concurrent.ExecutorService 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
public java.util.concurrent.ScheduledExecutorService 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
protected void shutdown(BaseContainer.ShutDownCondition shutDownCondition)
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.
-
-