org.kth.dks.util
Class ReusableFuture

java.lang.Object
  extended by org.kth.dks.util.Future
      extended by org.kth.dks.util.ReusableFuture

public class ReusableFuture
extends Future

Implements a Future that is reset after it returns an object with get()

Title: DKS

Description: DKS Middleware

Copyright: Copyright (c) 2004

Company: KTH-IMIT/SICS

Version:
1.0
Author:
not attributable

Constructor Summary
ReusableFuture()
           
 
Method Summary
 java.lang.Object get()
          Same functionality as Future.get() but in addition resets its flags such that it can be reused as if it was a new Future
 java.lang.Object get(long timeout)
          Same functionality as Future.get() but in addition resets its flags such that it can be reused as if it was a new Future
 
Methods inherited from class org.kth.dks.util.Future
cancel, cancel, isCancelled, isDone, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReusableFuture

public ReusableFuture()
Method Detail

get

public java.lang.Object get()
                     throws java.lang.InterruptedException,
                            CancellationException,
                            java.lang.Exception
Same functionality as Future.get() but in addition resets its flags such that it can be reused as if it was a new Future

Overrides:
get in class Future
Returns:
Object
Throws:
java.lang.InterruptedException
CancellationException
java.lang.Exception
See Also:
Future

get

public java.lang.Object get(long timeout)
                     throws TimeoutException,
                            java.lang.InterruptedException,
                            CancellationException
Same functionality as Future.get() but in addition resets its flags such that it can be reused as if it was a new Future

Overrides:
get in class Future
Parameters:
timeout - long
Returns:
Object
Throws:
TimeoutException
java.lang.InterruptedException
CancellationException
See Also:
Future


Copyright © 2010. All Rights Reserved.