org.glassfish.grizzly.filterchain
Class AbstractFilterChain

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

public abstract class AbstractFilterChain
extends java.lang.Object
implements FilterChain

Abstract FilterChain implementation, which redirects Processor.process(org.glassfish.grizzly.Context) call to the FilterChain.execute(org.glassfish.grizzly.filterchain.FilterChainContext)

Author:
Alexey Stashok
See Also:
FilterChain

Field Summary
protected  java.util.EnumSet<IOEvent> interestedIoEventsMask
           
 
Constructor Summary
AbstractFilterChain()
           
 
Method Summary
protected  void finalize()
           
 int indexOfType(java.lang.Class<? extends Filter> filterType)
          Get the index of Filter in chain, which type is filterType, or -1 if the Filter of required type was not found.
 boolean isInterested(IOEvent ioEvent)
          Is this Processor interested in processing the i/o event
 Context obtainContext(Connection connection)
          Creates Context
 FilterChainContext obtainFilterChainContext(Connection connection)
           
 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.glassfish.grizzly.filterchain.FilterChain
execute, fail, fireEventDownstream, fireEventUpstream, flush, read
 
Methods inherited from interface org.glassfish.grizzly.Processor
process, read, write
 
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

interestedIoEventsMask

protected final java.util.EnumSet<IOEvent> interestedIoEventsMask
Constructor Detail

AbstractFilterChain

public AbstractFilterChain()
Method Detail

indexOfType

public int indexOfType(java.lang.Class<? extends Filter> filterType)
Get the index of Filter in chain, which type is filterType, or -1 if the Filter of required type was not found.

Specified by:
indexOfType in interface FilterChain
Parameters:
filterType - the type of Filter to search.
Returns:
the index of Filter in chain, which type is filterType, or -1 if the Filter of required type was not found.

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.

obtainFilterChainContext

public final FilterChainContext obtainFilterChainContext(Connection connection)
Specified by:
obtainFilterChainContext in interface FilterChain

obtainContext

public final Context obtainContext(Connection connection)
Creates Context

Specified by:
obtainContext in interface Processor
Parameters:
connection - Connection to obtain processor for.
Returns:
Context, or null, if default Context could be used.

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable


Copyright © 2011 Oracle Corpration. All Rights Reserved.