Class ShutdownEvent
- java.lang.Object
-
- org.glassfish.grizzly.filterchain.ShutdownEvent
-
- All Implemented Interfaces:
FilterChainEvent
public class ShutdownEvent extends Object implements FilterChainEvent
An event thatFilter
implementations may listen for if special processing is required during a graceful shutdown.- Since:
- 2.4.0
-
-
Constructor Summary
Constructors Constructor Description ShutdownEvent(long gracePeriod, TimeUnit timeUnit)
Create a newShutdownEvent
with the grace period for the shutdown.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addShutdownTask(Callable<Filter> future)
Adds a task to this event.long
getGracePeriod()
Set<Callable<Filter>>
getShutdownTasks()
TimeUnit
getTimeUnit()
Object
type()
-
-
-
Field Detail
-
TYPE
public static final Object TYPE
-
-
Constructor Detail
-
ShutdownEvent
public ShutdownEvent(long gracePeriod, TimeUnit timeUnit)
Create a newShutdownEvent
with the grace period for the shutdown.
-
-
Method Detail
-
type
public Object type()
- Specified by:
type
in interfaceFilterChainEvent
-
addShutdownTask
public void addShutdownTask(Callable<Filter> future)
Adds a task to this event. Tasks should be called on separate threads after allFilter
s in the chain have been notified of the impending shutdown.
-
getGracePeriod
public long getGracePeriod()
- Returns:
- the shutdown grace period.
-
-