Top Description Fields Constructors Methods
org.glassfish.grizzly.filterchain

public Class ShutdownEvent

extends Object
implements FilterChainEvent
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.filterchain.FilterChainEvent
Imports
java.util.Collections, .LinkedHashSet, .Set, java.util.concurrent.Callable, .TimeUnit

An event that Filter implementations may listen for if special processing is required during a graceful shutdown.
Since
2.4.0

Field Summary

Modifier and TypeField and Description
private long
private Set<Callable<Filter>>
private TimeUnit
public static final Object

Constructor Summary

AccessConstructor and Description
public
ShutdownEvent(final long gracePeriod, final TimeUnit timeUnit)

Create a new ShutdownEvent with the grace period for the shutdown.

Method Summary

Modifier and TypeMethod and Description
public void
addShutdownTask(final Callable<Filter> future)

Adds a task to this event.

public long
getGracePeriod()

Returns: the shutdown grace period.

public Set<Callable<Filter>>
getShutdownTasks()

Returns: a Set of Callable<Filter> instances that need to be checked in order to proceed with terminating processing.

public TimeUnit
getTimeUnit()

Returns: the TimeUnit of the grace period.

public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

gracePeriodback to summary
private long gracePeriod
shutdownFuturesback to summary
private Set<Callable<Filter>> shutdownFutures
timeUnitback to summary
private TimeUnit timeUnit
TYPEback to summary
public static final Object TYPE

Constructor Detail

ShutdownEventback to summary
public ShutdownEvent(final long gracePeriod, final TimeUnit timeUnit)

Create a new ShutdownEvent with the grace period for the shutdown.

Method Detail

addShutdownTaskback to summary
public void addShutdownTask(final 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.

getGracePeriodback to summary
public long getGracePeriod()
Returns:long

the shutdown grace period.

getShutdownTasksback to summary
public Set<Callable<Filter>> getShutdownTasks()
Returns:Set<Callable<Filter>>

a Set of Callable<Filter> instances that need to be checked in order to proceed with terminating processing.

getTimeUnitback to summary
public TimeUnit getTimeUnit()
Returns:TimeUnit

the TimeUnit of the grace period.

typeback to summary
public Object type()

Implements org.glassfish.grizzly.filterchain.FilterChainEvent.type.

Annotations
@Override