com.vinculumtech.platform.async
Class Future

java.lang.Object
  extended bycom.vinculumtech.platform.async.Future

public final class Future
extends java.lang.Object

The Future class is a convenience function that allows for asynchronous invocations handled by a NullaryFunction. The Result object can be tested to see if the long running NullaryFunction has completed.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/platform/async/Future.java#3 $

Constructor Summary
Future()
           
Future(NullaryFunction function)
           
 
Method Summary
 Result getResult()
          Retrieves the Result object the returned value from the NullaryFunction will be given.
 Result invoke()
          Invokes the NullaryFunction provided on the constructor.
 Result invoke(NullaryFunction function)
          Invokes the given NullaryFunction.
 void setFunction(NullaryFunction function)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Future

public Future()

Future

public Future(NullaryFunction function)
Method Detail

getResult

public Result getResult()
Retrieves the Result object the returned value from the NullaryFunction will be given.

Returns:

setFunction

public void setFunction(NullaryFunction function)

invoke

public Result invoke(NullaryFunction function)
Invokes the given NullaryFunction.

Parameters:
function -
Returns:
a Result instance used to query the completion

invoke

public Result invoke()
Invokes the NullaryFunction provided on the constructor.

Returns:
a Result instance used to query the completion


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.