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

Comparing projects/cms/source/server/uk/org/iscream/cms/server/filter/TCPReader.java (file contents):
Revision 1.1 by tdb, Mon Nov 27 00:43:17 2000 UTC vs.
Revision 1.7 by tdb, Thu Jan 18 23:15:50 2001 UTC

# Line 1 | Line 1
1   //---PACKAGE DECLARATION---
2 + package uk.ac.ukc.iscream.filter;
3  
4   //---IMPORTS---
5   import uk.ac.ukc.iscream.core.*;
6 + import uk.ac.ukc.iscream.componentmanager.*;
7   import uk.ac.ukc.iscream.filter.*;
8   import java.net.Socket;
9   import java.net.ServerSocket;
# Line 9 | Line 11 | import java.io.OutputStream;
11   import java.io.IOException;
12   import java.net.InetAddress;
13   import java.net.UnknownHostException;
14 < import org.omg.CORBA.*;
13 < import org.omg.CosNaming.*;
14 > import uk.ac.ukc.iscream.util.*;
15  
16   /**
17   * A socket listener to listen for new hosts registering with the system.
# Line 40 | Line 41 | class TCPReader extends Thread {
41       * @param configManager a reference to the ConfigurationManager we are using
42           * @param port The port that the server will listen on.
43           */
44 <    public TCPReader(Logger logger, ConfigurationManager configManager, int port, Filter parent) {
44 <        _logger = logger;
45 <        _configManager = configManager;
44 >    public TCPReader(int port, Queue queue) {
45          _port = port;
46 <        _parent = parent;
46 >        _queue = queue;
47          _logger.write(toString(), Logger.SYSINIT, "started");
48      }
49  
# Line 97 | Line 96 | class TCPReader extends Thread {
96              if(run){
97                                  try {
98                                      // Setup the HostInit so it can carry on communications with the host
99 <                    TCPReaderInit init = new TCPReaderInit(hostSocket, _configManager, _logger, _parent);
99 >                    TCPReaderInit init = new TCPReaderInit(hostSocket, _queue);
100                                      // and start it
101                      init.start();
102                  } catch (IOException e) {
# Line 113 | Line 112 | class TCPReader extends Thread {
112       * Overrides the {@link java.lang.Object#toString() Object.toString()}
113       * method to provide clean logging (every class should have this).
114       *
115 +     * This uses the uk.ac.ukc.iscream.util.NameFormat class
116 +     * to format the toString()
117 +     *
118       * @return the name of this class and its CVS revision
119       */
120      public String toString() {
121 <        return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
121 >        return FormatName.getName(
122 >            _name,
123 >            getClass().getName(),
124 >            REVISION);
125      }
126  
127   //---PRIVATE METHODS---
# Line 126 | Line 131 | class TCPReader extends Thread {
131   //---ATTRIBUTES---
132      
133      /**
134 <     * A reference to the logger the system is using
134 >     * This is the friendly identifier of the
135 >     * component this class is running in.
136 >     * eg, a Filter may be called "filter1",
137 >     * If this class does not have an owning
138 >     * component,  a name from the configuration
139 >     * can be placed here.  This name could also
140 >     * be changed to null for utility classes.
141       */
142 <    Logger _logger;
143 <    
142 >    private String _name = FilterMain.NAME;
143 >
144      /**
145 <     * A reference to the configurator the system is using
145 >     * This holds a reference to the
146 >     * system logger that is being used.
147       */
148 <    ConfigurationManager _configManager;
148 >    private Logger _logger = ReferenceManager.getInstance().getLogger();
149      
150      /**
151           * The port on which the server should listen.
152           */
153      private int _port;
154      
155 <    private Filter _parent;
155 >    private Queue _queue;
156      
157   //---STATIC ATTRIBUTES---
158  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines