com.sun.grizzly.util
Class FutureImpl<R>

java.lang.Object
  extended by com.sun.grizzly.util.FutureImpl<R>
All Implemented Interfaces:
Future<R>

public class FutureImpl<R>
extends Object
implements Future<R>

Default Future implementation

Author:
Alexey Stashok

Field Summary
protected  R result
           
 
Constructor Summary
FutureImpl()
           
FutureImpl(Object sync)
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
 R get()
           
 R get(long timeout, TimeUnit unit)
           
 R getResult()
           
 boolean isCancelled()
           
 boolean isDone()
           
protected  void notifyHaveResult()
           
 void setException(Throwable failure)
           
 void setResult(R result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

protected R result
Constructor Detail

FutureImpl

public FutureImpl()

FutureImpl

public FutureImpl(Object sync)
Method Detail

getResult

public R getResult()

setResult

public void setResult(R result)

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface Future<R>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<R>

isDone

public boolean isDone()
Specified by:
isDone in interface Future<R>

get

public R get()
      throws InterruptedException,
             ExecutionException
Specified by:
get in interface Future<R>
Throws:
InterruptedException
ExecutionException

get

public R get(long timeout,
             TimeUnit unit)
      throws InterruptedException,
             ExecutionException,
             TimeoutException
Specified by:
get in interface Future<R>
Throws:
InterruptedException
ExecutionException
TimeoutException

setException

public void setException(Throwable failure)

notifyHaveResult

protected void notifyHaveResult()


Copyright © 2012 Oracle Corporation. All Rights Reserved.