edu.vub.at.actors.eventloops
Interface Future

All Known Implementing Classes:
BlockingFuture

public interface Future

A future is a placeholder for a 'return value' that is not yet computed. A future can either be resolved into a value or it can be ruined by an exception.

Author:
tvcutsem

Method Summary
 java.lang.Object get()
          Used to retrieve the real value from the future.
 void resolve(java.lang.Object result)
          Used to resolve the future into the given result object.
 void ruin(java.lang.Exception exception)
          Used to ruin the future with the given exception.
 

Method Detail

resolve

public void resolve(java.lang.Object result)
Used to resolve the future into the given result object. This will notify any threads waiting for the value.


ruin

public void ruin(java.lang.Exception exception)
Used to ruin the future with the given exception. This will notify any threads waiting for the value.


get

public java.lang.Object get()
                     throws java.lang.Exception
Used to retrieve the real value from the future.

Returns:
the resolved value of the future, once it is available.
Throws:
java.lang.Exception - if the future has been ruined with an exception.