|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
zeus.actors.intrays.NIOServer
this is a souped up version of the native socket transport to take advantage of the nio libraries.
| Field Summary | |
protected Address |
address
|
private java.nio.ByteBuffer |
buffer
|
private java.util.LinkedList |
clients
|
protected int |
connection_count
|
private AgentContext |
context
|
static int |
DEFAULT_PORT_MAX
|
static int |
DEFAULT_PORT_MIN
|
protected Queue |
inMail
Data structure holding messages as they are read in |
(package private) java.nio.channels.SelectionKey |
key
|
protected java.net.ServerSocket |
listenSocket
|
static int |
MAX_CONNECTIONS
|
static int |
MAX_QUEUE_LENGTH
|
int |
maxMessageSize
|
protected MailBox |
mbox
Reference to MailBox of which this is a sub-component |
protected MsgHandler |
msgHandler
|
protected boolean |
processing
|
private java.nio.channels.Selector |
readSelector
|
(package private) java.nio.channels.Selector |
selector
|
(package private) java.nio.channels.ServerSocketChannel |
server
|
(package private) java.nio.channels.SelectionKey |
serverKey
|
(package private) java.net.ServerSocket |
socket
|
protected long |
timeout
timeout was originally private, but subclasses need to use it to construct there own treads of control, so I changed it to protected (ST -14/8/00) |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
NIOServer()
|
|
NIOServer(AgentContext context,
MailBox mbox,
Queue inMail)
|
|
| Method Summary | |
void |
debug(java.lang.String str)
|
protected void |
finalize()
|
Address |
getAddress()
|
AgentContext |
getAgentContext()
|
java.lang.String |
getResponseAddress()
implement in haste, repent at leisure |
void |
lowerStatus()
|
void |
newMsg(Performative msg)
ensures that messages are processed // synchronized |
void |
normalStatus()
|
void |
registerClient(java.nio.channels.SocketChannel client)
|
void |
run()
|
void |
serviceClients()
|
void |
stopProcessing()
|
void |
updateCount(int x)
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int MAX_CONNECTIONS
public static final int MAX_QUEUE_LENGTH
public static final int DEFAULT_PORT_MIN
public static final int DEFAULT_PORT_MAX
public int maxMessageSize
protected java.net.ServerSocket listenSocket
protected Address address
protected int connection_count
protected boolean processing
private AgentContext context
private java.nio.ByteBuffer buffer
protected long timeout
protected Queue inMail
protected MailBox mbox
protected MsgHandler msgHandler
java.nio.channels.Selector selector
java.nio.channels.ServerSocketChannel server
java.nio.channels.SelectionKey key
java.nio.channels.SelectionKey serverKey
private java.util.LinkedList clients
private java.nio.channels.Selector readSelector
java.net.ServerSocket socket
| Constructor Detail |
public NIOServer()
public NIOServer(AgentContext context,
MailBox mbox,
Queue inMail)
| Method Detail |
public AgentContext getAgentContext()
public void updateCount(int x)
public void stopProcessing()
public void lowerStatus()
public void normalStatus()
public void run()
run in interface java.lang.Runnable
public void serviceClients()
throws java.io.IOException
java.io.IOException
public void registerClient(java.nio.channels.SocketChannel client)
throws java.io.IOException
java.io.IOExceptionprotected void finalize()
public Address getAddress()
public void newMsg(Performative msg)
public java.lang.String getResponseAddress()
getResponseAddress in interface InTraypublic void debug(java.lang.String str)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||