net.spy.util
Class Promise

java.lang.Object
  extended by net.spy.util.Promise

public abstract class Promise
extends java.lang.Object

A promise, continuation style code for java.


Constructor Summary
Promise()
          Get an instance of Promise.
 
Method Summary
protected abstract  java.lang.Object execute()
          Do the actual work required to get the Object we're promised.
 java.lang.Object getObject()
          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

getObject

public final java.lang.Object getObject()
                                 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 java.lang.Object execute()
                                     throws BrokenPromiseException
Do the actual work required to get the Object we're promised.

Throws:
BrokenPromiseException


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