|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.impl.SafeFutureImpl<R>
public class SafeFutureImpl<R>
Safe FutureImpl implementation.
(Based on the JDK FutureTask)
Future| Constructor Summary | |
|---|---|
SafeFutureImpl()
Creates SafeFutureImpl |
|
| Method Summary | ||
|---|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
|
static
|
create()
Construct SafeFutureImpl. |
|
protected void |
done(int lifeCounter)
Protected method invoked when this task transitions to state isDone (whether normally or via cancellation). |
|
void |
failure(java.lang.Throwable failure)
Notify about the failure, occurred during asynchronous operation execution. |
|
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. |
|
protected void |
reset()
|
|
void |
result(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 |
| Constructor Detail |
|---|
public SafeFutureImpl()
| Method Detail |
|---|
public static <R> SafeFutureImpl<R> create()
SafeFutureImpl.
public boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<R>public boolean isDone()
isDone in interface java.util.concurrent.Future<R>public boolean cancel(boolean mayInterruptIfRunning)
cancel 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.util.concurrent.CancellationException
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.util.concurrent.CancellationException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutExceptionpublic R getResult()
getResult in interface FutureImpl<R>public void result(R result)
result in interface FutureImpl<R>result - the result valuepublic void failure(java.lang.Throwable failure)
failure in interface FutureImpl<R>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.protected void reset()
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 Cacheableprotected void done(int lifeCounter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||