java.lang.Object
org.glassfish.grizzly.StandaloneProcessor
- All Implemented Interfaces:
Processor
Processor, which is not interested in processing I/O events. Connection lifecycle should be managed
explicitly, using read/write/accept/connect methods.
This Processor could be set on Connection to avoid it from being processed by FilterChain or
other Processor. In this case Connection could be used like regular Java Socket.- Author:
- Alexey Stashok
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetStreamReader(Connection connection) getStreamWriter(Connection connection) booleanisInterested(IOEvent ioEvent) StandaloneProcessoris not interested in anyIOEvent.obtainContext(Connection connection) CreatesContextThis method should never be called, becauseisInterested(IOEvent)returns false for anyIOEvent.voidread(Connection connection, CompletionHandler completionHandler) voidsetInterested(IOEvent ioEvent, boolean isInterested) Method does nothing.voidwrite(Connection connection, Object dstAddress, Object message, CompletionHandler completionHandler) voidwrite(Connection connection, Object dstAddress, Object message, CompletionHandler completionHandler, MessageCloner messageCloner) voidwrite(Connection connection, Object dstAddress, Object message, CompletionHandler completionHandler, PushBackHandler pushBackHandler) Deprecated.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
StandaloneProcessor
public StandaloneProcessor()
-
-
Method Details
-
process
This method should never be called, becauseisInterested(IOEvent)returns false for anyIOEvent. -
isInterested
StandaloneProcessoris not interested in anyIOEvent.- Specified by:
isInterestedin interfaceProcessor- 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
Method does nothing.- Specified by:
setInterestedin interfaceProcessor- Parameters:
ioEvent-IOEventisInterested- true, ifProcessoris interested in processing of the I/O event, or false otherwise.
-
obtainContext
Description copied from interface:ProcessorCreatesContext- Specified by:
obtainContextin interfaceProcessor- Parameters:
connection-Connectionto obtain processor for.- Returns:
Context, or null, if defaultContextcould be used.
-
getStreamReader
- Parameters:
connection-Connectionto get theStreamReaderfor- Returns:
- the
ConnectionStreamReader, to read data from theConnection.
-
getStreamWriter
- Parameters:
connection- connection to get theStreamWriterfor- Returns:
- the
ConnectionStreamWriter, to write data to theConnection.
-
read
-
write
public void write(Connection connection, Object dstAddress, Object message, CompletionHandler completionHandler) -
write
public void write(Connection connection, Object dstAddress, Object message, CompletionHandler completionHandler, MessageCloner messageCloner) -
write
@Deprecated public void write(Connection connection, Object dstAddress, Object message, CompletionHandler completionHandler, PushBackHandler pushBackHandler) Deprecated.
-