QJCC homepage

biz.chitec.quarterback.gjsa.server
Class ServerReader

java.lang.Object
  extended byjava.lang.Thread
      extended bybiz.chitec.quarterback.gjsa.server.ServerReader
All Implemented Interfaces:
java.lang.Runnable

public class ServerReader
extends java.lang.Thread

Reader thread for one client connection. Used for connectionbound connections as seperate reader thread. Uses SocketLayer on the one side to communicate with the socket and ThreadInterface to ServerThreadBase on the other side to pass read stuff to

Version:
$Id: 65fe9f3d18d24a981886fdd857b1e4628244ad11 $
Author:
cantamen/Dirk Hillbrecht 2003 Distributed under the terms of the GNU LGPL.

Field Summary
private  boolean dostop
          Flag to indicate that the reader should stop operation
private  long lastreadts
          time stamp on last action on socket
private  Logger mess
          target for logging messages
private  int myconnnr
          connection number for log message identification
private  ServerThreadBase myhandler
          the handler this reader belongs to
private  SocketLayer sly
          The one keeping track of the socket
private  ThreadInterface ti
          Interface to main handler
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerReader(SocketLayer slyx, ServerThreadBase sthx, ThreadInterface tix)
           
 
Method Summary
 void doStop()
          Indicator to stop operation.
 long getLastReadTimeStamp()
           
 void run()
          Main run loop.
 
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sly

private SocketLayer sly
The one keeping track of the socket


ti

private ThreadInterface ti
Interface to main handler


mess

private Logger mess
target for logging messages


myconnnr

private int myconnnr
connection number for log message identification


lastreadts

private long lastreadts
time stamp on last action on socket


myhandler

private ServerThreadBase myhandler
the handler this reader belongs to


dostop

private boolean dostop
Flag to indicate that the reader should stop operation

Constructor Detail

ServerReader

public ServerReader(SocketLayer slyx,
                    ServerThreadBase sthx,
                    ThreadInterface tix)
             throws java.io.IOException
Method Detail

getLastReadTimeStamp

public long getLastReadTimeStamp()

doStop

public void doStop()
Indicator to stop operation.


run

public void run()
Main run loop. Simply reads from SocketLayer's socket and writes into the ThreadInterface. Stops if to-be-closed or problems with the socket. On end, always closes the ThreadInterface, so that the complete handling thread will be shut down, too.


QJCC homepage