|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.nio.Reactor.PendingOperation
abstract class Reactor.PendingOperation
Manages a single asynchronous IO operation for a
Reactor.ReactiveAsyncKey. Behaves appropriately when no operation is
pending, or when a race occurs between, e.g., timeout and user
cancellation.
| Field Summary | |
|---|---|
protected AtomicReference<Reactor.AsyncOp<?>> |
task
The continuation of the IO task to perform, if one is pending, or a reference to null if an operation is not pending. |
| Constructor Summary | |
|---|---|
Reactor.PendingOperation(Reactor.ReactiveAsyncKey asyncKey,
int op)
Creates a new instance to manage the given operation for the given key. |
|
| Method Summary | ||
|---|---|---|
(package private) void |
cleanupTask()
Marks the operation as no-longer-pending, and cancels the timeout expiration action for the task, if any. |
|
(package private)
|
execute(A attachment,
CompletionHandler<R,? super A> handler,
long timeout,
TimeUnit unit,
Callable<R> callable)
Attempts to initiate an asynchronous operation. |
|
(package private) boolean |
isPending()
Returns true if this operation is pending, otherwise
false. |
|
protected abstract void |
pendingPolicy()
Overridden by subclasses to take the appropriate action when an attempt is made to invoke this operation while it is already pending. |
|
(package private) void |
selected()
Runs the pending operation, if any. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final AtomicReference<Reactor.AsyncOp<?>> task
null if an operation is not pending.
| Constructor Detail |
|---|
Reactor.PendingOperation(Reactor.ReactiveAsyncKey asyncKey,
int op)
asyncKey - the async keyop - the operation to manage| Method Detail |
|---|
protected abstract void pendingPolicy()
This method must always throw an unchecked exception.
void selected()
AsyncKey.selected(int)boolean isPending()
true if this operation is pending, otherwise
false.
true if this operation is pending, otherwise
falseAsyncKey.isOpPending(int)void cleanupTask()
<R,A> IoFuture<R,A> execute(A attachment,
CompletionHandler<R,? super A> handler,
long timeout,
TimeUnit unit,
Callable<R> callable)
pendingPolicy().
R - the result typeA - the attachment typeattachment - the attachment for the completion handler; may
be nullhandler - the completion handler; may be nulltimeout - the timeout, or 0 indicating no timeoutunit - the unit of the timeoutcallable - the IO action to perform when this operation is
ready
IoFuture representing the pending operationAsyncKey.execute(int, Object, CompletionHandler, long,
TimeUnit, Callable)public String toString()
toString in class Object
|
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 | |||||||||