|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.kaariboga.io.ListenThread
Listens on the specified port and spawns new threads to receive incoming messages.
Field Summary | |
private KbMessageHandler |
messageHandler
Handles the incoming messages |
private int |
port
Port on which to listen for new messages. |
private java.util.Collection |
receivingThreads
Collection of all threads currently receiving messages |
private boolean |
shouldLive
Should this thread continue to live or terminate? |
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
ListenThread(KbMessageHandler handler,
int port,
java.util.Collection threads)
|
Method Summary | |
void |
run()
Listens on a server socket and spawns new threads to receive messages. |
void |
terminate()
Terminates this thread. |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private volatile boolean shouldLive
private KbMessageHandler messageHandler
private java.util.Collection receivingThreads
private int port
Constructor Detail |
public ListenThread(KbMessageHandler handler, int port, java.util.Collection threads)
handler
- A KbMessageHandler to handle incoming messagesport
- The port number on which the server socket listens for messages.threads
- Collection of the threads, currently receiving messages.Method Detail |
public void run()
run
in class java.lang.Thread
public void terminate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |