- 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:
java.util.EventListener
,IoFuture.Notifier<T,A>
public abstract static class IoFuture.HandlingNotifier<T,A> extends java.lang.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 standardIoFuture.Notifier
implementations.- Since:
- 1.1
-
-
Constructor Summary
Constructors Constructor Description HandlingNotifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleCancelled(A attachment)
Handle cancellation.void
handleDone(T data, A attachment)
Handle completion.void
handleFailed(java.io.IOException exception, A attachment)
Handle failure.void
notify(IoFuture<? extends T> future, A attachment)
Receive notification of the completion of an outstanding operation.
-
-
-
Method Detail
-
notify
public void notify(IoFuture<? extends T> future, A attachment)
Receive notification of the completion of an outstanding operation.- Specified by:
notify
in interfaceIoFuture.Notifier<T,A>
- Parameters:
future
- the future corresponding to this operationattachment
- the attachment
-
handleCancelled
public void handleCancelled(A attachment)
Handle cancellation.- Parameters:
attachment
- the attachment
-
handleFailed
public void handleFailed(java.io.IOException exception, A attachment)
Handle failure.- Parameters:
exception
- the failure reasonattachment
- the attachment
-
-