dk.itu.smds.torusman
Class ServerListener
java.lang.Object
java.lang.Thread
dk.itu.smds.torusman.ServerListener
- All Implemented Interfaces:
- java.lang.Runnable
public class ServerListener
- extends java.lang.Thread
The listener interface for receiving server events.
The class that is interested in processing a server
event implements this interface, and the object created
with that class is registered with a component using the
component's addServerListener method. When
the server event occurs, that object's appropriate
method is invoked.
- See Also:
ServerEvent
Nested classes/interfaces inherited from class java.lang.Thread |
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary |
void |
addListener(java.io.DataInputStream in,
ServerTime time)
Adds the listener. |
void |
run()
Listens for packages on all connections to the clients
and passes them to the sender. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ins
public java.io.DataInputStream[] ins
- The ins.
latestAdd
public volatile int latestAdd
- The latest add.
sender
public ServerSender sender
- The sender.
time
public ServerTime time
- The time.
lt
public LocalTorus lt
- The lt.
ServerListener
public ServerListener(int size,
ServerSender s)
- Instantiates a new server listener.
- Parameters:
size
- the sizes
- the s
addListener
public void addListener(java.io.DataInputStream in,
ServerTime time)
- Adds the listener.
- Parameters:
in
- the intime
- the time
run
public void run()
- Listens for packages on all connections to the clients
and passes them to the sender.
- Specified by:
run
in interface java.lang.Runnable
- Overrides:
run
in class java.lang.Thread
- See Also:
Thread.run()