Package org.xnio
Class IoFuture.HandlingNotifier<T,A>
java.lang.Object
org.xnio.IoFuture.HandlingNotifier<T,A>
- Type Parameters:
T- the type of result that the associated future operation producesA- the attachment type
- All Implemented Interfaces:
EventListener,IoFuture.Notifier<T,A>
public abstract static class IoFuture.HandlingNotifier<T,A>
extends Object
implements IoFuture.Notifier<T,A>
A base notifier class that calls the designated handler method on notification. Use this class to reduce
boilerplate for standard
IoFuture.Notifier implementations.- Since:
- 1.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleCancelled(A attachment) Handle cancellation.voidhandleDone(T data, A attachment) Handle completion.voidhandleFailed(IOException exception, A attachment) Handle failure.voidReceive notification of the completion of an outstanding operation.
-
Constructor Details
-
HandlingNotifier
public HandlingNotifier()
-
-
Method Details
-
notify
Receive notification of the completion of an outstanding operation.- Specified by:
notifyin interfaceIoFuture.Notifier<T,A> - Parameters:
future- the future corresponding to this operationattachment- the attachment
-
handleCancelled
Handle cancellation.- Parameters:
attachment- the attachment
-
handleFailed
Handle failure.- Parameters:
exception- the failure reasonattachment- the attachment
-
handleDone
Handle completion.- Parameters:
data- the resultattachment- the attachment
-