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.12 by ajm, Tue Dec 12 19:17:02 2000 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines