|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.impl.UnsafeFutureImpl<R>
public class UnsafeFutureImpl<R>
Simple thread-unsafe Future implementation.
Future| Field Summary | |
|---|---|
protected java.lang.Throwable |
failure
|
protected boolean |
isCancelled
|
protected boolean |
isDone
|
protected int |
recycleMark
|
protected R |
result
|
| Method Summary | ||
|---|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
|
static
|
create()
Construct Future. |
|
void |
failure(java.lang.Throwable failure)
Notify about the failure, occured 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. |
|
protected void |
notifyHaveResult()
Notify blocked listeners threads about operation completion. |
|
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 |
| Field Detail |
|---|
protected boolean isDone
protected boolean isCancelled
protected java.lang.Throwable failure
protected R result
protected int recycleMark
| Method Detail |
|---|
public static <R> UnsafeFutureImpl<R> create()
Future.
public R getResult()
getResult in interface FutureImpl<R>public void result(R result)
result in interface FutureImpl<R>result - the result valuepublic 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)
failure in interface FutureImpl<R>failure - protected void notifyHaveResult()
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 Cacheable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||