net.spy.util
Class Promise<T>

java.lang.Object
  extended by net.spy.util.Promise<T>

public abstract class Promise<T>
extends java.lang.Object

A promise, continuation style code for java.


Constructor Summary
Promise()
          Get an instance of Promise.
 
Method Summary
protected abstract  T execute()
          Do the actual work required to get the Object we're promised.
 T get()
          Get the object.
 java.lang.String toString()
          Print me.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Promise

public Promise()
Get an instance of Promise.

Method Detail

get

public final T get()
            throws BrokenPromiseException
Get the object.

Returns:
the Object we were promised.
Throws:
BrokenPromiseException - if there's a problem getting what we were promised.

toString

public java.lang.String toString()
Print me.

Overrides:
toString in class java.lang.Object

execute

protected abstract T execute()
                      throws BrokenPromiseException
Do the actual work required to get the Object we're promised.

Throws:
BrokenPromiseException


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.