Interface Operation
- All Superinterfaces:
Runnable
- All Known Subinterfaces:
Negotiation
- All Known Implementing Classes:
FlushSignaller
,FrameCollector
,Handshake
,Handshake.Committer
,Handshake.Consumer
,Handshake.Producer
,Phase
,RequestReader
,SocketAcceptor
,TransportDispatcher
The
Operation
interface is used to describe a task
that can be executed when the associated channel is ready for some
operation. Typically the SelectableChannel
is used to
register with a selector with a set of given interested operations
when those operations can be performed this is executed.- See Also:
-
Method Summary
-
Method Details
-
getTrace
Trace getTrace()This is used to acquire the trace object that is associated with the operation. A trace object is used to collection details on what operations are being performed. For instance it may contain information relating to I/O events or errors.- Returns:
- this returns the trace associated with this operation
-
getChannel
SelectableChannel getChannel()This is theSelectableChannel
which is used to determine if the operation should be executed. If the channel is ready for a given I/O event it can be run. For instance if the operation is used to perform some form of read operation it can be executed when ready to read data from the channel.- Returns:
- this returns the channel used to govern execution
-
cancel
void cancel()This is used to cancel the operation if it has timed out. This is typically invoked when it has been waiting in a selector for an extended duration of time without any active operations on it. In such a case the reactor must purge the operation to free the memory and open channels associated with the operation.
-