|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.impl.ReadyFutureImpl<R>
public final class ReadyFutureImpl<R>
Future implementation with the specific unmodifiable result.
Future| Field Summary | |
|---|---|
protected R |
result
|
| Method Summary | ||
|---|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
Do nothing. |
|
static
|
create()
Construct cancelled Future. |
|
static
|
create(R result)
Construct Future with the result. |
|
static
|
create(Throwable failure)
Construct failed Future. |
|
void |
failure(Throwable failure)
Should not be called for ReadyFutureImpl |
|
R |
get()
|
|
R |
get(long timeout,
TimeUnit unit)
|
|
R |
getResult()
Get current result value without any blocking. |
|
boolean |
isCancelled()
|
|
boolean |
isDone()
|
|
void |
markForRecycle(boolean recycleResult)
Mark GrizzlyFuture as recycleable, so once result will come - GrizzlyFuture object will be recycled and returned to a thread local object pool. |
|
void |
recycle()
|
|
void |
recycle(boolean recycleResult)
Recycle GrizzlyFuture now. |
|
void |
result(R result)
Set the result value and notify about operation completion. |
|
void |
setResult(R result)
Should not be called for ReadyFutureImpl |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected R result
| Method Detail |
|---|
public static <R> ReadyFutureImpl<R> create()
Future.
public static <R> ReadyFutureImpl<R> create(R result)
Future with the result.
public static <R> ReadyFutureImpl<R> create(Throwable failure)
Future.
public R getResult()
getResult in interface FutureImpl<R>public void setResult(R result)
public 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 in interface FutureImpl<R>public void result(R result)
FutureImpl
result in interface FutureImpl<R>result - the result valuepublic void markForRecycle(boolean recycleResult)
GrizzlyFuture
markForRecycle in interface GrizzlyFuture<R>recycleResult - if true - the GrizzlyFuture result,
if it support recycleable mechanism, will be also recycled together
with this GrizzlyFuture object.public void recycle()
recycle in interface Cacheablepublic void recycle(boolean recycleResult)
GrizzlyFuture
recycle in interface GrizzlyFuture<R>recycleResult - if true - the GrizzlyFuture result,
if it support recycleable mechanism, will be also recycled together
with this GrizzlyFuture object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||