ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/filtermanager/HostInit.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/filtermanager/HostInit.java (file contents):
Revision 1.11 by tdb, Thu Dec 7 00:02:17 2000 UTC vs.
Revision 1.14 by tdb, Thu Jan 18 23:15:09 2001 UTC

# Line 5 | Line 5 | package uk.ac.ukc.iscream.filtermanager;
5   import uk.ac.ukc.iscream.core.*;
6   import uk.ac.ukc.iscream.filter.*;
7   import uk.ac.ukc.iscream.util.*;
8 + import uk.ac.ukc.iscream.componentmanager.*;
9   import java.net.Socket;
10   import java.io.*;
11  
12   /**
13   * Handles setting up a host.
14 + * This class provides a host with appropriate configuration
15 + * and a reference to a Filter to which it should pass data.
16   *
17   * @author  $Author$
18   * @version $Id$
# Line 138 | Line 141 | class HostInit extends Thread {
141              }
142              
143          } catch (Exception e) {
144 <            _logger.write(toString(), Logger.ERROR, "ERROR: " + e.getMessage());
144 >            _logger.write(toString(), Logger.ERROR, "ERROR - " + e.getMessage());
145          }
146          
147          _socketOut.flush();
# Line 157 | Line 160 | class HostInit extends Thread {
160       * Overrides the {@link java.lang.Object#toString() Object.toString()}
161       * method to provide clean logging (every class should have this).
162       *
163 +     * This uses the uk.ac.ukc.iscream.util.NameFormat class
164 +     * to format the toString()
165 +     *
166       * @return the name of this class and its CVS revision
167       */
168      public String toString() {
169 <        return this.getClass().getName() + "{" + _socket.getInetAddress().getHostName()
170 <         + "}(" + REVISION.substring(11, REVISION.length() - 2) + ")";
171 <        
169 >        return FormatName.getName(
170 >            _name,
171 >            getClass().getName(),
172 >            REVISION);
173      }
174  
175   //---PRIVATE METHODS---
# Line 172 | Line 179 | class HostInit extends Thread {
179   //---ATTRIBUTES---
180  
181      /**
182 <     * A reference to the logger the system is using
182 >     * This holds a reference to the
183 >     * system logger that is being used.
184       */
185 <    Logger _logger = ReferenceManager.getInstance().getLogger();
185 >    private Logger _logger = ReferenceManager.getInstance().getLogger();
186      
187      /**
188       * A reference to the Configuration Manager the system is using
189       */
190 <    ConfigurationManager _configManager = ReferenceManager.getInstance().getCM();
190 >    private ConfigurationManager _configManager = ReferenceManager.getInstance().getCM();
191      
192 <    Socket _socket;
193 <    BufferedReader _socketIn;
194 <    PrintWriter _socketOut;
192 >    /**
193 >     * This is the friendly identifier of the
194 >     * component this class is running in.
195 >     * eg, a Filter may be called "filter1",
196 >     * If this class does not have an owning
197 >     * component,  a name from the configuration
198 >     * can be placed here.  This name could also
199 >     * be changed to null for utility classes.
200 >     */
201 >    private String _name = FilterManager.NAME;
202 >    
203 >    /**
204 >     * The socket this class uses
205 >     */
206 >    private Socket _socket;
207 >
208 >    /**
209 >     * Used for the input stream of this socket
210 >     */
211 >    private BufferedReader _socketIn;
212 >    
213 >    /**
214 >     * Used for the output stream of this socket
215 >     */
216 >    private PrintWriter _socketOut;
217  
218   //---STATIC ATTRIBUTES---
219  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines