|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Filter
A Filter encapsulates a unit of processing work to be performed,
whose purpose is to examine and/or modify the state of a transaction that is
represented by a FilterChainContext. Individual Filter can be assembled
into a FilterChain, which allows them to either complete the required
processing or delegate further processing to the next Filter in the
FilterChain.
Filter implementations should be designed in a thread-safe manner,
suitable for inclusion in multiple FilterChain that might be
processed by different threads simultaneously. In general, this implies that
Filter classes should not maintain state information in instance variables.
Instead, state information should be maintained via suitable modifications to
the attributes of the FilterChainContext that is passed to the
appropriate Filter processing methods.
Filter implementations typically retrieve and store state information
in the FilterChainContext instance that is passed as a parameter
to the appropriate Filter processing methods,
using particular Attributes that can
be acquired via Attribute.get(org.glassfish.grizzly.attributes.AttributeStorage) method.
FilterChain,
Attribute| Method Summary | |
|---|---|
void |
exceptionOccurred(FilterChainContext ctx,
java.lang.Throwable error)
Notification about exception, occurred on the FilterChain |
NextAction |
handleAccept(FilterChainContext ctx)
Execute a unit of processing work to be performed, when server channel has accepted the client connection. |
NextAction |
handleClose(FilterChainContext ctx)
Execute a unit of processing work to be performed, when connection has been closed. |
NextAction |
handleConnect(FilterChainContext ctx)
Execute a unit of processing work to be performed, when channel gets connected. |
NextAction |
handleEvent(FilterChainContext ctx,
FilterChainEvent event)
Handle custom event associated with the Connection. |
NextAction |
handleRead(FilterChainContext ctx)
Execute a unit of processing work to be performed, when channel will become available for reading. |
NextAction |
handleWrite(FilterChainContext ctx)
Execute a unit of processing work to be performed, when some data should be written on channel. |
void |
onAdded(FilterChain filterChain)
Method is called, when the Filter has been added to the passed FilterChain. |
void |
onFilterChainChanged(FilterChain filterChain)
Method is called, when the FilterChain this Filter is part of,
has been changed. |
void |
onRemoved(FilterChain filterChain)
Method is called, when the Filter has been removed from the passed FilterChain. |
| Method Detail |
|---|
void onAdded(FilterChain filterChain)
FilterChain.
filterChain - the FilterChain this Filter was added to.void onRemoved(FilterChain filterChain)
FilterChain.
filterChain - the FilterChain this Filter was removed from.void onFilterChainChanged(FilterChain filterChain)
FilterChain this Filter is part of,
has been changed.
filterChain - the FilterChain.
NextAction handleRead(FilterChainContext ctx)
throws java.io.IOException
Filter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.
ctx - FilterChainContext
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
java.io.IOException
NextAction handleWrite(FilterChainContext ctx)
throws java.io.IOException
Filter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.
ctx - FilterChainContext
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
java.io.IOException
NextAction handleConnect(FilterChainContext ctx)
throws java.io.IOException
Filter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.
ctx - FilterChainContext
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
java.io.IOException
NextAction handleAccept(FilterChainContext ctx)
throws java.io.IOException
Filter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.
ctx - FilterChainContext
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
java.io.IOException
NextAction handleEvent(FilterChainContext ctx,
FilterChainEvent event)
throws java.io.IOException
Connection.
This Filter may either complete the required processing and
return StopAction, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning InvokeAction.
ctx - FilterChainContextevent -
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
java.io.IOException
NextAction handleClose(FilterChainContext ctx)
throws java.io.IOException
Filter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.
ctx - FilterChainContext
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
java.io.IOException
void exceptionOccurred(FilterChainContext ctx,
java.lang.Throwable error)
FilterChain
ctx - event processing FilterChainContexterror - error, which occurred during FilterChain execution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||