Class BaseContainer

All Implemented Interfaces:
WebSocketContainer
Direct Known Subclasses:
ClientManager, TyrusServerContainer

public abstract class BaseContainer extends ExecutorServiceProvider implements WebSocketContainer
Base WebSocket container.

Client and Server containers extend this to provide additional functionality.

Author:
Jitendra Kotamraju
  • Constructor Details

    • BaseContainer

      public BaseContainer()
  • Method Details

    • getExecutorService

      public ExecutorService getExecutorService()
      Returns a container-managed ExecutorService registered under java:comp/DefaultManagedExecutorService or if the lookup has failed, it returns a ExecutorService created and managed by this instance of BaseContainer.
      Specified by:
      getExecutorService in class ExecutorServiceProvider
      Returns:
      executor service.
    • getScheduledExecutorService

      public ScheduledExecutorService getScheduledExecutorService()
      Returns a container-managed ScheduledExecutorService registered under java:comp/DefaultManagedScheduledExecutorService or if the lookup has failed it returns a ScheduledExecutorService created and managed by this instance of BaseContainer.
      Specified by:
      getScheduledExecutorService in class ExecutorServiceProvider
      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 to true. 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.