|
barchart-udt-core 2.3.0-SNAPSHOT / 2013-05-13T01:37:38.485-0500 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.nio.channels.SelectionKey
com.barchart.udt.nio.SelectionKeyUDT
public class SelectionKeyUDT
UDT selection key implementation.
| Field Summary | |
|---|---|
protected static int |
HAS_READ
JDK interest to Epoll READ mapping. |
protected static int |
HAS_WRITE
JDK interest to Epoll WRITE mapping. |
protected static org.slf4j.Logger |
log
|
| Fields inherited from class java.nio.channels.SelectionKey |
|---|
OP_ACCEPT, OP_CONNECT, OP_READ, OP_WRITE |
| Constructor Summary | |
|---|---|
protected |
SelectionKeyUDT(SelectorUDT selectorUDT,
ChannelUDT channelUDT,
Object attachment)
|
| Method Summary | |
|---|---|
protected void |
assertValidKey()
Ensure key is NOT canceled. |
protected void |
assertValidOps(int interestOps)
Ensure only permitted interest mask bits are present. |
void |
cancel()
|
SelectableChannel |
channel()
|
protected ChannelUDT |
channelUDT()
Underlying UDT channel. |
int |
compareTo(SelectionKeyUDT that)
|
protected boolean |
doRead(int resultIndex)
Apply READ readiness according to KindUDT channel role. |
protected boolean |
doWrite(int resultIndex)
Apply WRITE readiness according to KindUDT channel role. |
protected EpollUDT.Opt |
epollOpt()
Requested interest in epoll format. |
protected EpollUDT |
epollUDT()
Epoll bound to this key. |
boolean |
equals(Object otherKey)
Key equality based on socket-id. |
protected static EpollUDT.Opt |
from(int interestOps)
Convert select options : from jdk into epoll. |
int |
hashCode()
Key hach code based on socket-id. |
int |
interestOps()
|
SelectionKey |
interestOps(int interestOps)
|
protected boolean |
isSocketBroken()
Check socket termination status. |
boolean |
isValid()
|
protected KindUDT |
kindUDT()
Channel role. |
protected void |
logError(String comment)
Key processing logic error logger. |
protected void |
makeValid(boolean isValid)
Change socket registration with epoll, and change key validity status. |
int |
readyOps()
|
protected void |
readyOps(int ops)
|
SelectorUDT |
selector()
|
protected int |
socketId()
Id of a socket bound to this key. |
protected SocketUDT |
socketUDT()
Socket bound to this key. |
String |
toString()
|
static String |
toStringOps(int selectOps)
Render select options. |
| Methods inherited from class java.nio.channels.SelectionKey |
|---|
attach, attachment, isAcceptable, isConnectable, isReadable, isWritable |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int HAS_READ
protected static final int HAS_WRITE
protected static final org.slf4j.Logger log
| Constructor Detail |
|---|
protected SelectionKeyUDT(SelectorUDT selectorUDT,
ChannelUDT channelUDT,
Object attachment)
| Method Detail |
|---|
protected static EpollUDT.Opt from(int interestOps)
public static final String toStringOps(int selectOps)
protected void assertValidKey()
throws CancelledKeyException
CancelledKeyExceptionprotected void assertValidOps(int interestOps)
public void cancel()
cancel in class SelectionKeypublic SelectableChannel channel()
channel in class SelectionKeyprotected ChannelUDT channelUDT()
public int compareTo(SelectionKeyUDT that)
compareTo in interface Comparable<SelectionKeyUDT>protected boolean doRead(int resultIndex)
KindUDT channel role.
Note: doRead(int) is invoked before doWrite(int)
Sockets with exceptions are returned to both read and write sets.
protected boolean doWrite(int resultIndex)
KindUDT channel role.
Note: doRead(int) is invoked before doWrite(int)
Sockets with exceptions are returned to both read and write sets.
protected EpollUDT.Opt epollOpt()
protected EpollUDT epollUDT()
public boolean equals(Object otherKey)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int interestOps()
interestOps in class SelectionKeypublic SelectionKey interestOps(int interestOps)
interestOps in class SelectionKeyprotected boolean isSocketBroken()
StatusUDT.BROKEN or worsepublic boolean isValid()
isValid in class SelectionKeyprotected KindUDT kindUDT()
protected void logError(String comment)
protected void makeValid(boolean isValid)
public int readyOps()
readyOps in class SelectionKeyprotected void readyOps(int ops)
public SelectorUDT selector()
selector in class SelectionKeyprotected int socketId()
protected SocketUDT socketUDT()
public String toString()
toString in class Object
|
barchart-udt-core 2.3.0-SNAPSHOT / 2013-05-13T01:37:38.485-0500 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||