Class ShutdownEvent
- java.lang.Object
-
- org.glassfish.grizzly.filterchain.ShutdownEvent
-
- All Implemented Interfaces:
FilterChainEvent
public class ShutdownEvent extends java.lang.Object implements FilterChainEvent
An event thatFilterimplementations 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.ObjectTYPE
-
Constructor Summary
Constructors Constructor Description ShutdownEvent(long gracePeriod, java.util.concurrent.TimeUnit timeUnit)Create a newShutdownEventwith the grace period for the shutdown.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddShutdownTask(java.util.concurrent.Callable<Filter> future)Adds a task to this event.longgetGracePeriod()java.util.Set<java.util.concurrent.Callable<Filter>>getShutdownTasks()java.util.concurrent.TimeUnitgetTimeUnit()java.lang.Objecttype()
-
-
-
Constructor Detail
-
ShutdownEvent
public ShutdownEvent(long gracePeriod, java.util.concurrent.TimeUnit timeUnit)Create a newShutdownEventwith the grace period for the shutdown.
-
-
Method Detail
-
type
public java.lang.Object type()
- Specified by:
typein interfaceFilterChainEvent
-
addShutdownTask
public void addShutdownTask(java.util.concurrent.Callable<Filter> future)
Adds a task to this event. Tasks should be called on separate threads after allFilters in the chain have been notified of the impending shutdown.
-
getShutdownTasks
public java.util.Set<java.util.concurrent.Callable<Filter>> getShutdownTasks()
- Returns:
- a
SetofCallableinstances 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
TimeUnitof the grace period.
-
-