|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.impl.FutureLockImpl<R>
public class FutureLockImpl<R>
Simple Future implementation, which uses ReentrantLock
to synchronize during the lifecycle.
Future,
ReentrantLock| Field Summary | |
|---|---|
protected R |
result
|
| Constructor Summary | |
|---|---|
FutureLockImpl()
|
|
FutureLockImpl(ReentrantLock lock)
|
|
| Method Summary | |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
void |
failure(Throwable failure)
Notify about the failure, occured during asynchronous operation execution. |
R |
get()
|
R |
get(long timeout,
TimeUnit unit)
|
R |
getResult()
Get current result value without any blocking. |
boolean |
isCancelled()
|
boolean |
isDone()
|
protected void |
notifyHaveResult()
Notify blocked listeners threads about operation completion. |
void |
setResult(R result)
Set the result value and notify about operation completion. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected R result
| Constructor Detail |
|---|
public FutureLockImpl()
public FutureLockImpl(ReentrantLock lock)
| Method Detail |
|---|
public R getResult()
public void setResult(R result)
result - the result valuepublic boolean cancel(boolean mayInterruptIfRunning)
cancel in interface Future<R>public boolean isCancelled()
isCancelled in interface Future<R>public boolean isDone()
isDone in interface Future<R>
public R get()
throws InterruptedException,
ExecutionException
get in interface Future<R>InterruptedException
ExecutionException
public R get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
get in interface Future<R>InterruptedException
ExecutionException
TimeoutExceptionpublic void failure(Throwable failure)
failure - protected void notifyHaveResult()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||