Package org.glassfish.grizzly
Class StandaloneProcessor
- java.lang.Object
-
- org.glassfish.grizzly.StandaloneProcessor
-
- All Implemented Interfaces:
Processor
public class StandaloneProcessor extends Object implements Processor
Processor, which is not interested in processing I/O events.Connectionlifecycle should be managed explicitly, using read/write/accept/connect methods. ThisProcessorcould be set onConnectionto avoid it from being processed byFilterChainor otherProcessor. In this caseConnectioncould be used like regular JavaSocket.- Author:
- Alexey Stashok
-
-
Field Summary
Fields Modifier and Type Field Description static StandaloneProcessorINSTANCE
-
Constructor Summary
Constructors Constructor Description StandaloneProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StreamReadergetStreamReader(Connection connection)StreamWritergetStreamWriter(Connection connection)booleanisInterested(IOEvent ioEvent)StandaloneProcessoris not interested in anyIOEvent.ContextobtainContext(Connection connection)CreatesContextProcessorResultprocess(Context context)This 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 Detail
-
INSTANCE
public static final StandaloneProcessor INSTANCE
-
-
Method Detail
-
process
public ProcessorResult process(Context context)
This method should never be called, becauseisInterested(IOEvent)returns false for anyIOEvent.
-
isInterested
public boolean isInterested(IOEvent ioEvent)
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
public void setInterested(IOEvent ioEvent, boolean isInterested)
Method does nothing.- Specified by:
setInterestedin interfaceProcessor- Parameters:
ioEvent-IOEventisInterested- true, ifProcessoris interested in processing of the I/O event, or false otherwise.
-
obtainContext
public Context obtainContext(Connection connection)
Description copied from interface:ProcessorCreatesContext- Specified by:
obtainContextin interfaceProcessor- Parameters:
connection-Connectionto obtain processor for.- Returns:
Context, or null, if defaultContextcould be used.
-
getStreamReader
public StreamReader getStreamReader(Connection connection)
- Parameters:
connection-Connectionto get theStreamReaderfor- Returns:
- the
ConnectionStreamReader, to read data from theConnection.
-
getStreamWriter
public StreamWriter getStreamWriter(Connection connection)
- Parameters:
connection- connection to get theStreamWriterfor- Returns:
- the
ConnectionStreamWriter, to write data to theConnection.
-
read
public void read(Connection connection, CompletionHandler completionHandler)
-
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.
-
-