swpchat.server
Class ControlProtocolReceiverThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--swpchat.server.ControlProtocolReceiverThread
All Implemented Interfaces:
java.lang.Runnable

public class ControlProtocolReceiverThread
extends java.lang.Thread

class used for normal receiving of controlProtocol

Author:
Andre Brunner, Christian Stuellenberg, Marc Sturm

Field Summary
private static java.lang.String CLS
           
private  ControlProtocolHandler handler
           
private  int interruptCounter
           
private  java.net.Socket socket
           
private  int timeout
           
private  ChatStreamTokenizer tokenizer
           
private  java.util.Vector tokenlist
           
 
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
ControlProtocolReceiverThread(ControlProtocolHandler handler, ChatStreamTokenizer tokenizer, java.net.Socket socket)
          Constructor
 
Method Summary
 int getTimeout()
          returns the timeout on the socket.
 void run()
           
 void waitForSleepingReceiver()
          returns, iff the thread which runs this method owns the monitor on the socket
 void wakeUpSleepingReceiver()
          releases the monitor on the socket
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLS

private static final java.lang.String CLS

interruptCounter

private int interruptCounter

handler

private ControlProtocolHandler handler

tokenizer

private ChatStreamTokenizer tokenizer

socket

private java.net.Socket socket

tokenlist

private java.util.Vector tokenlist

timeout

private int timeout
Constructor Detail

ControlProtocolReceiverThread

public ControlProtocolReceiverThread(ControlProtocolHandler handler,
                                     ChatStreamTokenizer tokenizer,
                                     java.net.Socket socket)
Constructor
Parameters:
handler, - the referenz to the thread, that started this instance of a thread
tokenizer, - the tokenizer on the InputStream
socket, - the socket for this ControlProtocolHandler
Method Detail

run

public void run()
Overrides:
run in class java.lang.Thread

waitForSleepingReceiver

public void waitForSleepingReceiver()
                             throws java.lang.InterruptedException
returns, iff the thread which runs this method owns the monitor on the socket

wakeUpSleepingReceiver

public void wakeUpSleepingReceiver()
releases the monitor on the socket

getTimeout

public int getTimeout()
returns the timeout on the socket.
Returns:
an integer the contains the timeout on the socket