|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
cz.zcu.fav.kiv.cs.CSServerThread
Takes care of communication between one submodel and server.
| Field Summary | |
private java.net.Socket |
client
The socket for a communication between the server and the submodel. |
private int |
ID
This ID is the same as ID of submodel, that is to that thread connected. |
private java.io.BufferedReader |
in
The input channel. |
private java.io.PrintWriter[] |
outs
Array of output channels to all submodels. |
private CSServer |
server
The server which is common for all threads, offers common methods. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
CSServerThread(int ID,
java.net.Socket client,
CSServer server)
Creates the new thread, taking care of a communication between the submodel and the server. |
|
| Method Summary | |
private void |
readDistance(java.lang.String line)
Inserts distances from one process to his neighbours into cache. |
private void |
readSafeTimes(java.lang.String line)
Takes care of receiving of the safe times for other submodels from the submodel. |
void |
run()
Reads messages from the submodel. |
private void |
sendCancel(java.lang.String line)
Takes care of sending of a request to cancel a process. |
private void |
sendMessage(java.lang.String line)
Takes care of sending of a message from the submodel to a neighbour. |
private void |
simFinished()
This method is called, when the submodel has finished his simulation. |
| Methods inherited from class java.lang.Thread |
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, checkAccess, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private int ID
private java.net.Socket client
private CSServer server
private java.io.BufferedReader in
private java.io.PrintWriter[] outs
| Constructor Detail |
public CSServerThread(int ID,
java.net.Socket client,
CSServer server)
client - Socket Socket for this connectionserver - CSServer The main server, offering common methods.| Method Detail |
public void run()
private final void simFinished()
private void readSafeTimes(java.lang.String line)
line - String A message from the submodel with safe times for others.private final void sendMessage(java.lang.String line)
line - String A message from the submodel to the other.private void readDistance(java.lang.String line)
line - String A message from the submodel with distances from one process to his neigbours.private final void sendCancel(java.lang.String line)
line - String A message describing what events of what process should be canceled.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||