|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.nio.Reactor.ReactiveAsyncKey
class Reactor.ReactiveAsyncKey
Provides support for initiating asynchronous IO operations on
an underlying reactive channel registered with this Reactor.
AsyncKey| Field Summary | |
|---|---|
(package private) SelectionKey |
key
The SelectionKey representing the underlying channel's
registration with this Reactor's Selector. |
| Constructor Summary | |
|---|---|
Reactor.ReactiveAsyncKey(SelectionKey key)
Creates a new instance that wraps the given selector key. |
|
| Method Summary | ||
|---|---|---|
SelectableChannel |
channel()
Returns the underlying SelectableChannel for this key. |
|
void |
close()
Closes this key's underlying channel. |
|
|
execute(int op,
A attachment,
CompletionHandler<R,? super A> handler,
long timeout,
TimeUnit unit,
Callable<R> callable)
Initiates the given operation asynchronously on the underlying channel, and returns a future representing the result. |
|
void |
execute(Runnable command)
Executes the given command according to the execution policy determined by this key and channel group. |
|
boolean |
isOpPending(int op)
Returns whether the given operation is pending. |
|
|
runCompletion(CompletionHandler<R,A> handler,
A attachment,
Future<R> future)
Invokes the given completion handler, if it is not null;
otherwise does nothing. |
|
void |
selected(int readyOps)
Notifies this key that the given IO operations are ready on the underlying channel. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
final SelectionKey key
SelectionKey representing the underlying channel's
registration with this Reactor's Selector.
| Constructor Detail |
|---|
Reactor.ReactiveAsyncKey(SelectionKey key)
key - the selection key that represents the underlying
channel's registration with this reactor's selector| Method Detail |
|---|
public void close()
throws IOException
[Description copied from AsynchronousChannel.close()]
Any outstanding asynchronous operations upon this channel will
complete by throwing ExecutionException with cause
AsynchronousCloseException.
This method otherwise behaves exactly as specified by the
Channel interface.
This implementation does the following:
AsynchronousCloseException when they notice the
channel is closed.
close in interface AsyncKeyclose in interface CloseableIOException - if an I/O error occurspublic boolean isOpPending(int op)
isOpPending in interface AsyncKeyop - a SelectionKey opcode
true if the operation is pendingpublic SelectableChannel channel()
SelectableChannel for this key.
channel in interface AsyncKeySelectableChannel for this keypublic void selected(int readyOps)
selected in interface AsyncKeyreadyOps - the SelectionKey ops that are ready
public <R,A> IoFuture<R,A> execute(int op,
A attachment,
CompletionHandler<R,? super A> handler,
long timeout,
TimeUnit unit,
Callable<R> callable)
null completion handler is
provided, it will be invoked when the operation completes.
execute in interface AsyncKeyR - the result typeA - the attachment typeop - a SelectionKey opcodeattachment - the attachment for the IoFuture; may be
nullhandler - the completion handler; may be nulltimeout - the timeout for this operation, or 0 to wait
indefinitelyunit - the unit of the timeoutcallable - performs an IO operation on the underlying channel
when invoked
CompletionHandler,
AsynchronousChannelpublic void execute(Runnable command)
select().
execute in interface AsyncKeyexecute in interface Executorcommand - the command to run, possibly in another thread
public <R,A> void runCompletion(CompletionHandler<R,A> handler,
A attachment,
Future<R> future)
null;
otherwise does nothing.
Passes the handler an IoFuture constructed from the given
future and attachment object.
runCompletion in interface AsyncKeyR - the result typeA - the attachment typehandler - the completion handlerattachment - the attachment, or nullfuture - the resultpublic 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 | |||||||||