org.glassfish.grizzly.filterchain
Class AbstractFilterChain

java.lang.Object
  extended by org.glassfish.grizzly.filterchain.AbstractFilterChain
All Implemented Interfaces:
Iterable<Filter>, Collection<Filter>, List<Filter>, FilterChain, Processor
Direct Known Subclasses:
ListFacadeFilterChain

public abstract class AbstractFilterChain
extends Object
implements FilterChain

Abstract FilterChain implementation, which redirects com.sun.grizzly.Processor#process(com.sun.grizzly.Context) call to the AbstractFilterChain#execute(com.sun.grizzly.filterchain.FilterChainContext)

Author:
Alexey Stashok
See Also:
FilterChain

Field Summary
protected  FilterChainFactory factory
           
protected  ObjectPool<FilterChainContext> filterChainContextPool
          FilterChainContext object pool.
protected  IOEventMask interestedIoEventsMask
           
 
Constructor Summary
AbstractFilterChain(FilterChainFactory factory)
           
 
Method Summary
 void afterProcess(Context context)
          Method will be called by framework after Processor execution, so it can release associated resources.
 void beforeProcess(Context context)
          Method will be called by framework before executing this Processor.
 FilterChainContext context()
          Creates Context
abstract  ProcessorResult execute(FilterChainContext context)
          Method processes occured IOEvent on this FilterChain.
 FilterChainFactory getFactory()
          Get the FilterChainFactory, which created this FilterChain.
 boolean isInterested(IOEvent ioEvent)
          Is this Processor interested in processing the i/o event
 ProcessorResult process(Context context)
          Delegates processing to execute(org.glassfish.grizzly.filterchain.FilterChainContext)
 void setInterested(IOEvent ioEvent, boolean isInterested)
          Set the the i/o event, this Processor is interested in
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.glassfish.grizzly.filterchain.FilterChain
getCodec
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

factory

protected FilterChainFactory factory

interestedIoEventsMask

protected IOEventMask interestedIoEventsMask

filterChainContextPool

protected final ObjectPool<FilterChainContext> filterChainContextPool
FilterChainContext object pool.

Constructor Detail

AbstractFilterChain

public AbstractFilterChain(FilterChainFactory factory)
Method Detail

isInterested

public boolean isInterested(IOEvent ioEvent)
Is this Processor interested in processing the i/o event

Specified by:
isInterested in interface Processor
Returns:
true, if this Processor is interested and execution process will start, false otherwise.

setInterested

public void setInterested(IOEvent ioEvent,
                          boolean isInterested)
Set the the i/o event, this Processor is interested in

Specified by:
setInterested in interface Processor
Parameters:
ioEvent - IOEvent
isInterested - true, if Processor is interested in processing of the I/O event, or false otherwise.

getFactory

public FilterChainFactory getFactory()
Get the FilterChainFactory, which created this FilterChain.

Specified by:
getFactory in interface FilterChain
Returns:
FilterChainFactory.

beforeProcess

public void beforeProcess(Context context)
                   throws IOException
Method will be called by framework before executing this Processor.

Specified by:
beforeProcess in interface Processor
Parameters:
context - processing context
Throws:
IOException

process

public ProcessorResult process(Context context)
                        throws IOException
Delegates processing to execute(org.glassfish.grizzly.filterchain.FilterChainContext)

Specified by:
process in interface Processor
Parameters:
context - processing Context
Returns:
ProcessorResult
Throws:
IOException

afterProcess

public void afterProcess(Context context)
                  throws IOException
Method will be called by framework after Processor execution, so it can release associated resources.

Specified by:
afterProcess in interface Processor
Parameters:
context - processing context
Throws:
IOException

context

public FilterChainContext context()
Creates Context

Specified by:
context in interface Processor
Returns:
Context, or null, if default Context could be used.

execute

public abstract ProcessorResult execute(FilterChainContext context)
                                 throws IOException
Method processes occured IOEvent on this FilterChain.

Parameters:
context - processing context
Returns:
ProcessorResult
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.