com.sun.grizzly.filterchain
Class DefaultFilterChain

java.lang.Object
  extended by com.sun.grizzly.filterchain.AbstractFilterChain
      extended by com.sun.grizzly.filterchain.ListFacadeFilterChain
          extended by com.sun.grizzly.filterchain.DefaultFilterChain
All Implemented Interfaces:
FilterChain, Processor, Iterable<Filter>, Collection<Filter>, List<Filter>

public class DefaultFilterChain
extends ListFacadeFilterChain

Default FilterChain implementation

Author:
Alexey Stashok
See Also:
FilterChain, Filter

Nested Class Summary
static interface DefaultFilterChain.FilterExecutor
          Executes appropriate Filter processing method to process occured IOEvent.
 
Field Summary
 
Fields inherited from class com.sun.grizzly.filterchain.ListFacadeFilterChain
filters
 
Fields inherited from class com.sun.grizzly.filterchain.AbstractFilterChain
factory, filterChainContextPool, interestedIoEventsMask
 
Constructor Summary
DefaultFilterChain(FilterChainFactory factory)
           
 
Method Summary
 ProcessorResult execute(FilterChainContext ctx)
          Execute this FilterChain.
protected  boolean executeChain(FilterChainContext ctx, DefaultFilterChain.FilterExecutor executor)
          Sequentially lets each Filter in chain to process IOEvent.
 Codec getCodec()
          Get filter chain codec
protected  boolean postExecuteChain(FilterChainContext ctx, DefaultFilterChain.FilterExecutor executor)
          Sequentially lets each executed Filter to post process IOEvent.
protected  void throwChain(FilterChainContext ctx, Throwable exception)
          Notify the filters about error.
 
Methods inherited from class com.sun.grizzly.filterchain.ListFacadeFilterChain
add, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from class com.sun.grizzly.filterchain.AbstractFilterChain
afterProcess, beforeProcess, context, getFactory, isInterested, process, setInterested
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Constructor Detail

DefaultFilterChain

public DefaultFilterChain(FilterChainFactory factory)
Method Detail

execute

public ProcessorResult execute(FilterChainContext ctx)
Execute this FilterChain.

Specified by:
execute in class AbstractFilterChain
Parameters:
ctx - FilterChainContext processing context
Returns:
ProcessorResult
Throws:
Exception

executeChain

protected boolean executeChain(FilterChainContext ctx,
                               DefaultFilterChain.FilterExecutor executor)
                        throws Exception
Sequentially lets each Filter in chain to process IOEvent.

Parameters:
ctx - FilterChainContext processing context
executor - DefaultFilterChain.FilterExecutor, which will call appropriate filter operation to process IOEvent.
Returns:
false to terminate exectution, or true for normal exection process
Throws:
Exception

postExecuteChain

protected boolean postExecuteChain(FilterChainContext ctx,
                                   DefaultFilterChain.FilterExecutor executor)
                            throws Exception
Sequentially lets each executed Filter to post process IOEvent. The Filters will be called in opposite order they were called on processing phase.

Parameters:
ctx - FilterChainContext processing context
executor - DefaultFilterChain.FilterExecutor, which will call appropriate filter operation to post process IOEvent.
Returns:
false to terminate exectution, or true for normal exection process
Throws:
Exception

throwChain

protected void throwChain(FilterChainContext ctx,
                          Throwable exception)
Notify the filters about error.

Parameters:
ctx - FilterChainContext

getCodec

public Codec getCodec()
Get filter chain codec

Returns:
filter chain codec


Copyright © 2009 SUN Microsystems. All Rights Reserved.