java.lang.Object
org.glassfish.grizzly.ChainProcessorSelector
- All Implemented Interfaces:
Iterable<ProcessorSelector>,Collection<ProcessorSelector>,List<ProcessorSelector>,ProcessorSelector
public class ChainProcessorSelector
extends Object
implements ProcessorSelector, List<ProcessorSelector>
ProcessorSelector implementation, which acts like wrapper for chain of ProcessorSelectors. So, when
ProcessorSelector.select(IOEvent, Connection) operation is called - it delegates selecting to the first
ProcessorSelector from chain. If first ProcessorSelector returns not null Processor
- ChainProcessorSelector returns it as result, otherwise next ProcessorSelector will be taken from
chain... etc- Author:
- Alexey Stashok
-
Constructor Summary
ConstructorsConstructorDescriptionChainProcessorSelector(List<ProcessorSelector> selectorChain) ChainProcessorSelector(ProcessorSelector... selectorChain) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, ProcessorSelector element) booleanbooleanaddAll(int index, Collection<? extends ProcessorSelector> c) booleanaddAll(Collection<? extends ProcessorSelector> c) voidclear()booleanbooleancontainsAll(Collection<?> c) get(int index) intbooleanisEmpty()iterator()intlistIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) select(IOEvent ioEvent, Connection connection) SelectsProcessor, which will process connection event.set(int index, ProcessorSelector element) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator
-
Constructor Details
-
ChainProcessorSelector
public ChainProcessorSelector() -
ChainProcessorSelector
-
ChainProcessorSelector
-
-
Method Details
-
select
SelectsProcessor, which will process connection event.- Specified by:
selectin interfaceProcessorSelector- Parameters:
ioEvent- connection event to be processedconnection- where event occurred- Returns:
- the
Processor, which will process connection event.
-
size
public int size()- Specified by:
sizein interfaceCollection<ProcessorSelector>- Specified by:
sizein interfaceList<ProcessorSelector>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<ProcessorSelector>- Specified by:
isEmptyin interfaceList<ProcessorSelector>
-
contains
- Specified by:
containsin interfaceCollection<ProcessorSelector>- Specified by:
containsin interfaceList<ProcessorSelector>
-
iterator
- Specified by:
iteratorin interfaceCollection<ProcessorSelector>- Specified by:
iteratorin interfaceIterable<ProcessorSelector>- Specified by:
iteratorin interfaceList<ProcessorSelector>
-
toArray
- Specified by:
toArrayin interfaceCollection<ProcessorSelector>- Specified by:
toArrayin interfaceList<ProcessorSelector>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<ProcessorSelector>- Specified by:
toArrayin interfaceList<ProcessorSelector>
-
add
- Specified by:
addin interfaceCollection<ProcessorSelector>- Specified by:
addin interfaceList<ProcessorSelector>
-
remove
- Specified by:
removein interfaceCollection<ProcessorSelector>- Specified by:
removein interfaceList<ProcessorSelector>
-
containsAll
- Specified by:
containsAllin interfaceCollection<ProcessorSelector>- Specified by:
containsAllin interfaceList<ProcessorSelector>
-
addAll
- Specified by:
addAllin interfaceCollection<ProcessorSelector>- Specified by:
addAllin interfaceList<ProcessorSelector>
-
addAll
- Specified by:
addAllin interfaceList<ProcessorSelector>
-
removeAll
- Specified by:
removeAllin interfaceCollection<ProcessorSelector>- Specified by:
removeAllin interfaceList<ProcessorSelector>
-
retainAll
- Specified by:
retainAllin interfaceCollection<ProcessorSelector>- Specified by:
retainAllin interfaceList<ProcessorSelector>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<ProcessorSelector>- Specified by:
clearin interfaceList<ProcessorSelector>
-
get
- Specified by:
getin interfaceList<ProcessorSelector>
-
set
- Specified by:
setin interfaceList<ProcessorSelector>
-
add
- Specified by:
addin interfaceList<ProcessorSelector>
-
remove
- Specified by:
removein interfaceList<ProcessorSelector>
-
indexOf
- Specified by:
indexOfin interfaceList<ProcessorSelector>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<ProcessorSelector>
-
listIterator
- Specified by:
listIteratorin interfaceList<ProcessorSelector>
-
listIterator
- Specified by:
listIteratorin interfaceList<ProcessorSelector>
-
subList
- Specified by:
subListin interfaceList<ProcessorSelector>
-