uk.org.iscream.cms.server.filtermanager
Class HostInit

java.lang.Object
  extended by java.lang.Thread
      extended by uk.org.iscream.cms.server.filtermanager.HostInit
All Implemented Interfaces:
Runnable

 class HostInit
extends Thread

Handles setting up a host. This class provides a host with appropriate configuration and a reference to a Filter to which it should pass data.

Version:
$Id: HostInit.java,v 1.41 2005/09/25 09:57:42 tdb Exp $
Author:
$Author: tdb $

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  ConfigurationManager _configManager
          A reference to the Configuration Manager the system is using
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  Socket _socket
          The socket this class uses
private  BufferedReader _socketIn
          Used for the input stream of this socket
private  PrintWriter _socketOut
          Used for the output stream of this socket
 String REVISION
          The current CVS revision of this class
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HostInit(Socket socket)
          Construct a new HostInit.
 
Method Summary
private  String getInBound()
           
private  String getInBound(String expected)
           
 void run()
          Main method in this class, which handles communicating with the host to determine it's setup.
private  void send(String data)
           
 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, 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, 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

_logger

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


_configManager

private ConfigurationManager _configManager
A reference to the Configuration Manager the system is using


_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.


_socket

private Socket _socket
The socket this class uses


_socketIn

private BufferedReader _socketIn
Used for the input stream of this socket


_socketOut

private PrintWriter _socketOut
Used for the output stream of this socket

Constructor Detail

HostInit

public HostInit(Socket socket)
         throws IOException
Construct a new HostInit.

Parameters:
socket - The socket to which the host is connected
Throws:
IOException
Method Detail

run

public void run()
Main method in this class, which handles communicating with the host to determine it's setup.

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

getInBound

private String getInBound(String expected)
                   throws IOException
Throws:
IOException

getInBound

private String getInBound()
                   throws IOException
Throws:
IOException

send

private void send(String data)


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