public class SafeFutureImpl<R> extends FutureTask<R> implements FutureImpl<R>
FutureImpl
implementation.
(Based on the JDK FutureTask
)Future
Constructor and Description |
---|
SafeFutureImpl()
Creates SafeFutureImpl
|
Modifier and Type | Method and Description |
---|---|
static <R> SafeFutureImpl<R> |
create()
Construct
SafeFutureImpl . |
void |
failure(Throwable failure)
Notify about the failure, occurred during asynchronous operation execution.
|
R |
getResult()
Get current result value without any blocking.
|
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.
|
cancel, done, get, get, isCancelled, isDone, run, runAndReset, set, setException
public static <R> SafeFutureImpl<R> create()
SafeFutureImpl
.public void result(R result)
result
in interface FutureImpl<R>
result
- the result valuepublic void failure(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.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 R getResult()
FutureImpl
getResult
in interface FutureImpl<R>
Copyright © 2013 Oracle Corporation. All Rights Reserved.