uk.org.iscream.cms.server.clientinterface
Class TCPClientListener

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--uk.org.iscream.cms.server.clientinterface.TCPClientListener
All Implemented Interfaces:
Runnable

class TCPClientListener
extends Thread

Listener for incoming TCP clients, and startup a Handler a connection is received.

Version:
$Id: TCPClientListener.java,v 1.18 2003/02/05 16:43:46 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  Logger _logger
          This holds a reference to the system logger that is being used.
private  String _name
          This is the friendly identifier of the component this class is running in.
private  PacketSorter _packetSorter
          A reference to the PacketSorter.
static int DEFPORT
           
 String REVISION
          The current CVS revision of this class
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TCPClientListener(PacketSorter packetSorter)
          Constructs a new TCPClientListener
 
Method Summary
 void run()
          The run() method is the main loop for this thread, and we will remain in here until such a point as something goes wrong with the listening.
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 
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, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

DEFPORT

public static final int DEFPORT
See Also:
Constant Field Values

_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.


_logger

private Logger _logger
This holds a reference to the system logger that is being used.


_packetSorter

private PacketSorter _packetSorter
A reference to the PacketSorter.

Constructor Detail

TCPClientListener

public TCPClientListener(PacketSorter packetSorter)
Constructs a new TCPClientListener

Parameters:
packetSorter - A reference to the PacketSorter
Method Detail

run

public void run()
The run() method is the main loop for this thread, and we will remain in here until such a point as something goes wrong with the listening. After initially setting up the ServerSocket we go round a while loop receiving connections and then passing them off to handler processes to deal with.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.util.NameFormat class to format the toString()

Overrides:
toString in class Thread
Returns:
the name of this class and its CVS revision


Copyright © 2000-2003 i-scream. All Rights Reserved.