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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetStreamReader
(Connection connection) getStreamWriter
(Connection connection) boolean
isInterested
(IOEvent ioEvent) StandaloneProcessor
is not interested in anyIOEvent
.obtainContext
(Connection connection) CreatesContext
This method should never be called, becauseisInterested(IOEvent)
returns false for anyIOEvent
.void
read
(Connection connection, CompletionHandler completionHandler) void
setInterested
(IOEvent ioEvent, boolean isInterested) Method does nothing.void
write
(Connection connection, Object dstAddress, Object message, CompletionHandler completionHandler) void
write
(Connection connection, Object dstAddress, Object message, CompletionHandler completionHandler, MessageCloner messageCloner) void
write
(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
StandaloneProcessor
is not interested in anyIOEvent
.- Specified by:
isInterested
in interfaceProcessor
- Parameters:
ioEvent
- the event to check if the Processor is interested in- Returns:
- true, if this
Processor
is interested and execution process will start, false otherwise.
-
setInterested
Method does nothing.- Specified by:
setInterested
in interfaceProcessor
- Parameters:
ioEvent
-IOEvent
isInterested
- true, ifProcessor
is interested in processing of the I/O event, or false otherwise.
-
obtainContext
Description copied from interface:Processor
CreatesContext
- Specified by:
obtainContext
in interfaceProcessor
- Parameters:
connection
-Connection
to obtain processor for.- Returns:
Context
, or null, if defaultContext
could be used.
-
getStreamReader
- Parameters:
connection
-Connection
to get theStreamReader
for- Returns:
- the
Connection
StreamReader
, to read data from theConnection
.
-
getStreamWriter
- Parameters:
connection
- connection to get theStreamWriter
for- Returns:
- the
Connection
StreamWriter
, 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.
-