Interface DeactivatedContainer

All Known Implementing Classes:
ContainerTermination

public interface DeactivatedContainer

This interface represents a Container which has been deactivated. An instance of this class is returned by the ContainerActivator.activateContainer(ContainerBuilder) method, and is used to schedule a cleanup task that is executed once the the deactivated Container has terminated.

Author:
Simon Thoresen Hult
  • Method Details

    • appContext

      Object appContext()

      Returns the context object that was previously attached to the corresponding ContainerBuilder through the ContainerBuilder.setAppContext(Object) method. This is useful for tracking Application specific resources that are to be tracked alongside a Container.

      Returns:
      The Application context.
    • notifyTermination

      void notifyTermination(Runnable task)

      Schedules the given Runnable to execute once this DeactivatedContainer has terminated. A DeactivatedContainer is considered to have terminated once there are no more Requests, Responses or corresponding ContentChannels being processed by components that belong to it.

      If termination has already occurred, this method immediately runs the given Runnable in the current thread.

      Parameters:
      task - The task to run once this DeactivatedContainer has terminated.