Interface SelectorManager.AcceptListener
- All Superinterfaces:
EventListener, SelectorManager.SelectorManagerListener
- All Known Implementing Classes:
AcceptRateLimit, ConnectionLimit, NetworkConnectionLimit
- Enclosing class:
SelectorManager
public static interface SelectorManager.AcceptListener
extends SelectorManager.SelectorManagerListener
A listener for accept events.
This listener is called from either the selector or acceptor thread and implementations must be non blocking and fast.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonAccepted(SelectableChannel channel) Called after the accepted channel has been allocated anEndPointand associatedConnection, and after the onOpen notifications have been called on both endPoint and connection.default voidonAcceptFailed(SelectableChannel channel, Throwable cause) Called if the processing of the accepted channel fails prior to callingonAccepted(SelectableChannel).default voidonAccepting(SelectableChannel channel) Called immediately after a new SelectableChannel is accepted, but before it has been submitted to theSelectorManager.default voidonClosed(SelectableChannel channel) Called when an acceptedSelectableChannelis closed.
-
Method Details
-
onAccepting
Called immediately after a new SelectableChannel is accepted, but before it has been submitted to theSelectorManager.- Parameters:
channel- the accepted channel
-
onAcceptFailed
Called if the processing of the accepted channel fails prior to callingonAccepted(SelectableChannel).- Parameters:
channel- the accepted channelcause- the cause of the failure
-
onAccepted
Called after the accepted channel has been allocated anEndPointand associatedConnection, and after the onOpen notifications have been called on both endPoint and connection.- Parameters:
channel- the accepted channel
-
onClosed
Called when an acceptedSelectableChannelis closed.- Parameters:
channel- the accepted channel
-