Class AbstractFilterChain
- java.lang.Object
-
- org.glassfish.grizzly.filterchain.AbstractFilterChain
-
- All Implemented Interfaces:
Iterable<Filter>,Collection<Filter>,List<Filter>,FilterChain,Processor<Context>
- Direct Known Subclasses:
ListFacadeFilterChain
public abstract class AbstractFilterChain extends Object implements FilterChain
AbstractFilterChainimplementation, which redirectsProcessor.process(org.glassfish.grizzly.Context)call to theFilterChain.execute(org.glassfish.grizzly.filterchain.FilterChainContext)- Author:
- Alexey Stashok
- See Also:
FilterChain
-
-
Field Summary
Fields Modifier and Type Field Description protected EnumSet<IOEvent>interestedIoEventsMask
-
Constructor Summary
Constructors Constructor Description AbstractFilterChain()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinalize()intindexOfType(Class<? extends Filter> filterType)booleanisInterested(IOEvent ioEvent)Is thisProcessorinterested in processing the i/o eventContextobtainContext(Connection connection)CreatesContextFilterChainContextobtainFilterChainContext(Connection connection)FilterChainContextobtainFilterChainContext(Connection connection, int startIdx, int endIdx, int currentIdx)FilterChainContextobtainFilterChainContext(Connection connection, Closeable closeable)FilterChainContextobtainFilterChainContext(Connection connection, Closeable closeable, int startIdx, int endIdx, int currentIdx)voidsetInterested(IOEvent ioEvent, boolean isInterested)Set the the i/o event, thisProcessoris interested inStringtoString()-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.glassfish.grizzly.filterchain.FilterChain
execute, fail, fireEventDownstream, fireEventUpstream, flush, read
-
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, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
indexOfType
public int indexOfType(Class<? extends Filter> filterType)
Get the index ofFilterin chain, which type is filterType, or -1 if theFilterof required type was not found.- Specified by:
indexOfTypein interfaceFilterChain- Parameters:
filterType- the type ofFilterto search.- Returns:
- the index of
Filterin chain, which type is filterType, or -1 if theFilterof required type was not found.
-
isInterested
public boolean isInterested(IOEvent ioEvent)
Is thisProcessorinterested in processing the i/o event- Specified by:
isInterestedin interfaceProcessor<Context>- Parameters:
ioEvent- the event to check if the Processor is interested in- Returns:
- true, if this
Processoris interested and execution process will start, false otherwise.
-
setInterested
public void setInterested(IOEvent ioEvent, boolean isInterested)
Set the the i/o event, thisProcessoris interested in- Specified by:
setInterestedin interfaceProcessor<Context>- Parameters:
ioEvent-IOEventisInterested- true, ifProcessoris interested in processing of the I/O event, or false otherwise.
-
obtainFilterChainContext
public final FilterChainContext obtainFilterChainContext(Connection connection)
- Specified by:
obtainFilterChainContextin interfaceFilterChain
-
obtainFilterChainContext
public FilterChainContext obtainFilterChainContext(Connection connection, Closeable closeable)
- Specified by:
obtainFilterChainContextin interfaceFilterChain
-
obtainFilterChainContext
public FilterChainContext obtainFilterChainContext(Connection connection, int startIdx, int endIdx, int currentIdx)
- Specified by:
obtainFilterChainContextin interfaceFilterChain
-
obtainFilterChainContext
public FilterChainContext obtainFilterChainContext(Connection connection, Closeable closeable, int startIdx, int endIdx, int currentIdx)
- Specified by:
obtainFilterChainContextin interfaceFilterChain
-
obtainContext
public final Context obtainContext(Connection connection)
CreatesContext- Specified by:
obtainContextin interfaceProcessor<Context>- Parameters:
connection-Connectionto obtain processor for.- Returns:
Context, or null, if defaultContextcould be used.
-
-