Package org.jenkinsci.remoting.protocol
Interface IOHubReadyListener
- All Known Implementing Classes:
NIONetworkLayer
public interface IOHubReadyListener
Interface for receiving callbacks when a
SelectableChannel
is ready on its registered
SelectionKey.interestOps()
.- Since:
- 3.0
- See Also:
-
IOHub.register(SelectableChannel, IOHubReadyListener, boolean, boolean, boolean, boolean, IOHubRegistrationCallback)
IOHub.addInterestAccept(SelectionKey)
IOHub.addInterestConnect(SelectionKey)
IOHub.addInterestRead(SelectionKey)
IOHub.addInterestWrite(SelectionKey)
IOHub.removeInterestAccept(SelectionKey)
IOHub.removeInterestConnect(SelectionKey)
IOHub.removeInterestRead(SelectionKey)
IOHub.removeInterestWrite(SelectionKey)
IOHub.unregister(SelectableChannel)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
ready
(boolean accept, boolean connect, boolean read, boolean write) Callback to indicate theSelectableChannel
that this listener was registered for is ready for the indicated operations.
-
Method Details
-
ready
void ready(boolean accept, boolean connect, boolean read, boolean write) Callback to indicate theSelectableChannel
that this listener was registered for is ready for the indicated operations. TheSelectionKey.interestOps()
will have been cleared for all the operations that aretrue
so the callback can be assured that processing of any one specific operation will be linearized, though there may be concurrent calls to ready() with disjoint ready operations. The callback will most likely want to re-register forIOHub.addInterestRead(SelectionKey)
orIOHub.addInterestAccept(SelectionKey)
immediately before returning from a ready notification of the read or accept status. The callback will only want to re-register for aIOHub.addInterestWrite(SelectionKey)
if it has filled theSelectableChannel
's output buffer and has more data to write.- Parameters:
accept
- if theSelectableChannel
has a connection to accept. CallIOHub.addInterestAccept(SelectionKey)
to request additional callbacks for this ready state.connect
- if theSelectableChannel
has established a connection. CallIOHub.addInterestConnect(SelectionKey)
to request additional callbacks for this ready state.read
- if theSelectableChannel
has data available to read. CallIOHub.addInterestRead(SelectionKey)
to request additional callbacks for this ready state.write
- if theSelectableChannel
can accept data for writing. CallIOHub.addInterestWrite(SelectionKey)
to request additional callbacks for this ready state.
-