XNIO version 1.2.1.GA

org.jboss.xnio
Class IoFuture.HandlingNotifier<T,A>

java.lang.Object
  extended by org.jboss.xnio.IoFuture.HandlingNotifier<T,A>
Type Parameters:
T - the type of result that the associated future operation produces
A - the attachment type
All Implemented Interfaces:
IoFuture.Notifier<T,A>
Enclosing interface:
IoFuture<T>

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
IoFuture.HandlingNotifier()
           
 
Method Summary
 void handleCancelled(A attachment)
          Handle cancellation.
 void handleDone(T result, A attachment)
          Handle completion.
 void handleFailed(IOException exception, A attachment)
          Handle failure.
 void notify(IoFuture<T> future, A attachment)
          Receive notification of the completion of an outstanding operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoFuture.HandlingNotifier

public IoFuture.HandlingNotifier()
Method Detail

notify

public void notify(IoFuture<T> future,
                   A attachment)
Receive notification of the completion of an outstanding operation.

Specified by:
notify in interface IoFuture.Notifier<T,A>
Parameters:
future - the future corresponding to this operation
attachment - the attachment

handleCancelled

public void handleCancelled(A attachment)
Handle cancellation.

Parameters:
attachment - the attachment

handleFailed

public void handleFailed(IOException exception,
                         A attachment)
Handle failure.

Parameters:
exception - the failure reason
attachment - the attachment

handleDone

public void handleDone(T result,
                       A attachment)
Handle completion.

Parameters:
result - the result
attachment - the attachment

XNIO version 1.2.1.GA

Copyright © 2008 JBoss, a division of Red Hat, Inc.