QJCC homepage

biz.chitec.quarterback.gjsa.server
Class ServerWriter

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

public class ServerWriter
extends java.lang.Thread

Writer thread for connectionbound connections. Only needed in connectionbound case where it creates the "writer thread". Waits for anything to arrive on its ThreadInterface and writes it out to the SocketLayer. ServerWriter takes control over the socket closing from SocketLayer as soon as its run() method is executed. In case of any error, especially a closed ThreadInterface, it will close the socket.

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

Field Summary
private  boolean dostop
           
private  int myconnnr
           
private  SocketLayer sly
           
private  ThreadInterface writerinterface
          interface to the writer thread.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerWriter(SocketLayer slyx, ServerThreadBase stbx, ThreadInterface tix)
          Constructor for a non-threadified ServerWriter.
 
Method Summary
 void doStop()
          Initiate a stop
 void run()
          Main run loop for threadified writers.
 
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

writerinterface

private ThreadInterface writerinterface
interface to the writer thread. Instantiated only once.


sly

private SocketLayer sly

myconnnr

private int myconnnr

dostop

private boolean dostop
Constructor Detail

ServerWriter

public ServerWriter(SocketLayer slyx,
                    ServerThreadBase stbx,
                    ThreadInterface tix)
             throws java.io.IOException
Constructor for a non-threadified ServerWriter. To use this ServerWriter, writeEnvelope() has to be called.

Throws:
java.io.IOException - Initialisation of socket wrapper classes failed
Method Detail

doStop

public void doStop()
Initiate a stop


run

public void run()
Main run loop for threadified writers. Loop stops either on any error at the socket or any error at the ThreadInterface. Through closing the ThreadInterface, it can therefore be closed explicitly.


QJCC homepage