|
||||||||||
| 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(FilterChainContext) method.
FilterChain,
Attribute| Method Summary | |
|---|---|
void |
exceptionOccurred(FilterChainContext ctx,
Throwable error)
Notification about exception, occured on the FilterChain |
NextAction |
handleAccept(FilterChainContext ctx,
NextAction nextAction)
Execute a unit of processing work to be performed, when server channel has accepted the client connection. |
NextAction |
handleClose(FilterChainContext ctx,
NextAction nextAction)
Execute a unit of processing work to be performed, when connection has been closed. |
NextAction |
handleConnect(FilterChainContext ctx,
NextAction nextAction)
Execute a unit of processing work to be performed, when channel gets connected. |
NextAction |
handleRead(FilterChainContext ctx,
NextAction nextAction)
Execute a unit of processing work to be performed, when channel will become available for reading. |
NextAction |
handleWrite(FilterChainContext ctx,
NextAction nextAction)
Execute a unit of processing work to be performed, when channel will become available for writing. |
NextAction |
postAccept(FilterChainContext ctx,
NextAction nextAction)
Execute any cleanup activities, such as releasing resources that were acquired during the execution of Filter#handleAccept(com.sun.grizzly.FilterChainContext) method of
this Filter instance. |
NextAction |
postClose(FilterChainContext ctx,
NextAction nextAction)
Execute any cleanup activities, such as releasing resources that were acquired during the execution of Filter#handleClose(com.sun.grizzly.FilterChainContext) method of
this Filter instance. |
NextAction |
postConnect(FilterChainContext ctx,
NextAction nextAction)
Execute any cleanup activities, such as releasing resources that were acquired during the execution of Filter#handleConnect(com.sun.grizzly.FilterChainContext) method of
this Filter instance. |
NextAction |
postRead(FilterChainContext ctx,
NextAction nextAction)
Execute any cleanup activities, such as releasing resources that were acquired during the execution of Filter#handleRead(com.sun.grizzly.FilterChainContext) method of
this Filter instance. |
NextAction |
postWrite(FilterChainContext ctx,
NextAction nextAction)
Execute any cleanup activities, such as releasing resources that were acquired during the execution of Filter#handleWrite(com.sun.grizzly.FilterChainContext) method of
this Filter instance. |
| Method Detail |
|---|
NextAction handleRead(FilterChainContext ctx,
NextAction nextAction)
throws 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 - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction postRead(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Filter#handleRead(com.sun.grizzly.FilterChainContext) method of
this Filter instance.
ctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction handleWrite(FilterChainContext ctx,
NextAction nextAction)
throws 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 - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction postWrite(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Filter#handleWrite(com.sun.grizzly.FilterChainContext) method of
this Filter instance.
ctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction handleConnect(FilterChainContext ctx,
NextAction nextAction)
throws 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 - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction postConnect(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Filter#handleConnect(com.sun.grizzly.FilterChainContext) method of
this Filter instance.
ctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction handleAccept(FilterChainContext ctx,
NextAction nextAction)
throws 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 - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction postAccept(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Filter#handleAccept(com.sun.grizzly.FilterChainContext) method of
this Filter instance.
ctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction handleClose(FilterChainContext ctx,
NextAction nextAction)
throws 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 - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
NextAction postClose(FilterChainContext ctx,
NextAction nextAction)
throws IOException
Filter#handleClose(com.sun.grizzly.FilterChainContext) method of
this Filter instance.
ctx - FilterChainContextnextAction - default NextAction, which Filter
could change in order to control how
FilterChain will continue the execution
NextAction instruction for FilterChain, how it
should continue the execution
{@link - java.io.IOException}
IOException
void exceptionOccurred(FilterChainContext ctx,
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 | |||||||||