Package org.glassfish.grizzly
Interface Processor<E extends Context>
-
- All Known Subinterfaces:
FilterChain
- All Known Implementing Classes:
AbstractFilterChain,DefaultFilterChain,ListFacadeFilterChain,StandaloneProcessor
public interface Processor<E extends Context>Processor implementations are responsible for processing I/O events, which occur on connection.- Author:
- Alexey Stashok
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanisInterested(IOEvent ioEvent)Is thisProcessorinterested in processing the i/o eventEobtainContext(Connection connection)CreatesContextProcessorResultprocess(E context)Method will be called by framework to process some event, which occurred on a connectionvoidread(Connection connection, CompletionHandler<ReadResult> completionHandler)voidsetInterested(IOEvent ioEvent, boolean isInterested)Set the the i/o event, thisProcessoris interested invoidwrite(Connection connection, Object dstAddress, Object message, CompletionHandler<WriteResult> completionHandler)voidwrite(Connection connection, Object dstAddress, Object message, CompletionHandler<WriteResult> completionHandler, MessageCloner messageCloner)voidwrite(Connection connection, Object dstAddress, Object message, CompletionHandler<WriteResult> completionHandler, PushBackHandler pushBackHandler)Deprecated.
-
-
-
Method Detail
-
obtainContext
E obtainContext(Connection connection)
CreatesContext- Parameters:
connection-Connectionto obtain processor for.- Returns:
Context, or null, if defaultContextcould be used.
-
process
ProcessorResult process(E context)
Method will be called by framework to process some event, which occurred on a connection- Parameters:
context- processing context- Returns:
- the result of I/O event processing
-
read
void read(Connection connection, CompletionHandler<ReadResult> completionHandler)
-
write
void write(Connection connection, Object dstAddress, Object message, CompletionHandler<WriteResult> completionHandler)
-
write
void write(Connection connection, Object dstAddress, Object message, CompletionHandler<WriteResult> completionHandler, MessageCloner messageCloner)
-
write
@Deprecated void write(Connection connection, Object dstAddress, Object message, CompletionHandler<WriteResult> completionHandler, PushBackHandler pushBackHandler)
Deprecated.
-
isInterested
boolean isInterested(IOEvent ioEvent)
Is thisProcessorinterested in processing the i/o event- 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.
-
-