Methods Summary |
---|
public java.lang.Object | get()
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.Object | get(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 boolean | isDone()
return delegate == null || delegate.isDone();
|
public void | release()
synchronized (this)
{
if (delegate == null)
{
released = true;
return;
}
}
delegate.release();
|
public void | setDelegate(Future delegate)
synchronized (this)
{
this.delegate = delegate;
if (released) delegate.release();
this.notifyAll();
}
|