|
||||||||||
| 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(java.lang.Throwable failure)
Construct failed Future. |
|
void |
failure(java.lang.Throwable failure)
Should not be called for ReadyFutureImpl |
|
R |
get()
|
|
R |
get(long timeout,
java.util.concurrent.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 |
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(java.lang.Throwable failure)
Future.
public R getResult()
public void setResult(R result)
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface java.util.concurrent.Future<R>public boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<R>public boolean isDone()
isDone in interface java.util.concurrent.Future<R>
public R get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<R>java.lang.InterruptedException
java.util.concurrent.ExecutionException
public R get(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
get in interface java.util.concurrent.Future<R>java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutExceptionpublic void failure(java.lang.Throwable failure)
public 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(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.public void recycle()
recycle in interface Cacheable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||