FileDocCategorySizeDatePackage
FutureProxy.javaAPI DocJBoss 4.2.12559Fri Jul 13 21:02:26 BST 2007org.jboss.aspects.asynch

FutureProxy

public class FutureProxy extends Object implements Future
Comment
author
Bill Burke
version
$Revision: 57186 $

Fields Summary
private Future
delegate
private boolean
released
Constructors Summary
Methods Summary
public java.lang.Objectget()

      synchronized (this)
      {
         if (delegate == null)
            this.wait();
         if (delegate == null) throw new RuntimeException("Failed to get delegate and timed out");
         return delegate.get();
      }
   
public java.lang.Objectget(long milliseconds)

      synchronized (this)
      {
         if (delegate == null)
         {
            this.wait(milliseconds);
            if (delegate == null) throw new TimeoutException("Failed to get delegate and timed out");
         }
      }
      return delegate.get(milliseconds);
   
public booleanisDone()

      return delegate == null || delegate.isDone();
   
public voidrelease()

      synchronized (this)
      {
         if (delegate == null)
         {
            released = true;
            return;
         }
      }
      delegate.release();
   
public voidsetDelegate(Future delegate)


      
   
      synchronized (this)
      {
         this.delegate = delegate;
         if (released) delegate.release();
         this.notifyAll();
      }