Class ShutdownEvent

  • All Implemented Interfaces:
    FilterChainEvent

    public class ShutdownEvent
    extends java.lang.Object
    implements FilterChainEvent
    An event that Filter implementations may listen for if special processing is required during a graceful shutdown.
    Since:
    2.4.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.Object TYPE  
    • Constructor Summary

      Constructors 
      Constructor Description
      ShutdownEvent​(long gracePeriod, java.util.concurrent.TimeUnit timeUnit)
      Create a new ShutdownEvent with the grace period for the shutdown.
    • Field Detail

      • TYPE

        public static final java.lang.Object TYPE
    • Constructor Detail

      • ShutdownEvent

        public ShutdownEvent​(long gracePeriod,
                             java.util.concurrent.TimeUnit timeUnit)
        Create a new ShutdownEvent with the grace period for the shutdown.
    • Method Detail

      • addShutdownTask

        public void addShutdownTask​(java.util.concurrent.Callable<Filter> future)
        Adds a task to this event. Tasks should be called on separate threads after all Filters in the chain have been notified of the impending shutdown.
      • getShutdownTasks

        public java.util.Set<java.util.concurrent.Callable<Filter>> getShutdownTasks()
        Returns:
        a Set of Callable instances that need to be checked in order to proceed with terminating processing.
      • getGracePeriod

        public long getGracePeriod()
        Returns:
        the shutdown grace period.
      • getTimeUnit

        public java.util.concurrent.TimeUnit getTimeUnit()
        Returns:
        the TimeUnit of the grace period.