public class SelectorRequest extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SelectorRequest.Status
the current status of the request.
|
static class |
SelectorRequest.Type
the types of events to be waited for.
|
Modifier and Type | Field and Description |
---|---|
SelectorRequestCallback |
callback |
SocketChannel |
channel |
SelectionKey |
key |
long |
nanoDeadline |
int |
op |
SelectorRequest.Status |
status |
SelectorRequest.Type |
type |
Constructor and Description |
---|
SelectorRequest(SelectorRequest.Type type,
SocketChannel channel,
SelectorRequestCallback callback,
long nanoDeadline)
Constructs a new SelectorRequest for an I/O event
|
SelectorRequest(SelectorRequestCallback callback,
long nanoDeadline)
Constructs a new SelectorRequest for an timer event
|
Modifier and Type | Method and Description |
---|---|
boolean |
isFinalized()
determines if the current status is one of the final statuses
|
void |
setStatus(SelectorRequest.Status status)
Called by the SelectorManager to notify a change of status.
|
SelectorRequest.Status |
waitOnCompletion(long nanoDeadline)
a blocking call to wait for a status change or a timeout.
|
public final SelectorRequest.Type type
public SelectorRequest.Status status
public final SocketChannel channel
public SelectionKey key
public final int op
public SelectorRequestCallback callback
public final long nanoDeadline
public SelectorRequest(SelectorRequest.Type type, SocketChannel channel, SelectorRequestCallback callback, long nanoDeadline)
type
- is the kind of event to wait forchannel
- is the I/O on which the event is expectedcallback
- is the object to be notified when the event occursnanoDeadline
- is an expiration time. It is an absolute time based upon System.nanoTime().
A deadline of '0' is used for no deadline.public SelectorRequest(SelectorRequestCallback callback, long nanoDeadline)
callback
- is the object to be notified when the event occursnanoDeadline
- is an expiration time. It is an absolute time based upon System.nanoTime().
A deadline of '0' is used for no deadline.public void setStatus(SelectorRequest.Status status)
public boolean isFinalized()
public SelectorRequest.Status waitOnCompletion(long nanoDeadline)
nanoDeadline
- is an explicit timeout for waiting on a changeCopyright © 2017 JacORB. All rights reserved.