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
| Modifier and Type | Method and Description |
|---|---|
| public void | exceptionOccurred(FilterChainContext
event processing ctx, Throwable FilterChainContexterror, which occurred during FilterChain execution error)Notification about exception, occurred on the |
| public NextAction | handleAccept(FilterChainContext ctx)
Execute a unit of processing work to be performed, when server channel has accepted the client connection. |
| public NextAction | handleClose(FilterChainContext ctx)
Execute a unit of processing work to be performed, when connection has been closed. |
| public NextAction | handleConnect(FilterChainContext ctx)
Execute a unit of processing work to be performed, when channel gets connected. |
| public NextAction | handleEvent(FilterChainContext ctx, FilterChainEvent event)
Handle custom event associated with the |
| public NextAction | handleRead(FilterChainContext ctx)
Execute a unit of processing work to be performed, when channel will become available for reading. |
| public NextAction | handleWrite(FilterChainContext ctx)
Execute a unit of processing work to be performed, when some data should be written on channel. |
| public void | onAdded(FilterChain
the filterChain)FilterChain this Filter was added to.Method is called, when the Filter has been added to the passed |
| public void | onFilterChainChanged(FilterChain
the filterChain)FilterChain.Method is called, when the |
| public void | onRemoved(FilterChain
the filterChain)FilterChain this Filter was removed from.Method is called, when the Filter has been removed from the passed |
| exceptionOccurred | back to summary |
|---|---|
| public void exceptionOccurred(FilterChainContext ctx, Throwable error) Notification about exception, occurred on the
| |
| handleAccept | back to summary |
|---|---|
| public NextAction handleAccept(FilterChainContext ctx) throws IOException Execute a unit of processing work to be performed, when server channel has accepted the client connection. This
| |
| handleClose | back to summary |
|---|---|
| public NextAction handleClose(FilterChainContext ctx) throws IOException Execute a unit of processing work to be performed, when connection has been closed. This
| |
| handleConnect | back to summary |
|---|---|
| public NextAction handleConnect(FilterChainContext ctx) throws IOException Execute a unit of processing work to be performed, when channel gets connected. This
| |
| handleEvent | back to summary |
|---|---|
| public NextAction handleEvent(FilterChainContext ctx, FilterChainEvent event) throws IOException Handle custom event associated with the
| |
| handleRead | back to summary |
|---|---|
| public NextAction handleRead(FilterChainContext ctx) throws IOException Execute a unit of processing work to be performed, when channel will become available for reading. This
| |
| handleWrite | back to summary |
|---|---|
| public NextAction handleWrite(FilterChainContext ctx) throws IOException Execute a unit of processing work to be performed, when some data should be written on channel. This
| |
| onAdded | back to summary |
|---|---|
| public void onAdded(FilterChain filterChain) Method is called, when the Filter has been added to the passed
| |
| onFilterChainChanged | back to summary |
|---|---|
| public void onFilterChainChanged(FilterChain filterChain) Method is called, when the
| |
| onRemoved | back to summary |
|---|---|
| public void onRemoved(FilterChain filterChain) Method is called, when the Filter has been removed from the passed
| |