|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.FutureTask<R>
com.sun.sgs.impl.nio.IoFutureTask<R,A>
R - the result typeA - the attachment typepublic class IoFutureTask<R,A>
An implementation of IoFuture that adds an object attachment to a
FutureTask.
| Constructor Summary | |
|---|---|
IoFutureTask(Callable<R> callable,
A attachment)
Creates an instance of this class for running the specified Callable and including the specified attachment. |
|
| Method Summary | ||
|---|---|---|
A |
attach(A newAttachment)
Attaches the given object to this channel future. |
|
A |
attachment()
Retrieves the current attachment. |
|
R |
getNow()
Retrieves the result of a completed operation. |
|
static
|
newInstance(Callable<R> callable,
A attachment)
Creates an instance of this class for running the specified Callable and including the specified attachment. |
|
| Methods inherited from class java.util.concurrent.FutureTask |
|---|
cancel, done, get, get, isCancelled, isDone, run, runAndReset, set, setException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.sgs.nio.channels.IoFuture |
|---|
cancel |
| Methods inherited from interface java.util.concurrent.Future |
|---|
get, get, isCancelled, isDone |
| Constructor Detail |
|---|
public IoFutureTask(Callable<R> callable,
A attachment)
Callable and including the specified attachment.
callable - the callable taskattachment - the attachment; may be null| Method Detail |
|---|
public static <R,A> IoFuture newInstance(Callable<R> callable,
A attachment)
Callable and including the specified attachment.
R - the result typeA - the attachment typecallable - the callable taskattachment - the attachment; may be null
IoFuture
public R getNow()
throws ExecutionException
The method is intended to be invoked from a CompletionHandler
to retrieve the result of a completed operation. It is equivalent to
invoking the get method to retrieve the result
except that the method does not wait for the result.
getNow in interface IoFuture<R,A>ExecutionException - if the operation threw an exceptionpublic A attachment()
attachment in interface IoFuture<R,A>null if there is no attachmentpublic A attach(A newAttachment)
An attached object may later be retrieved via the
attachment method. Only one object may be
attached at a time; invoking this method causes any previous
attachment to be discarded. The current attachment may be discarded
by attaching null.
attach in interface IoFuture<R,A>newAttachment - the object to be attached; may be null
null
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||