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.3 by tdb, Thu Nov 30 02:00:54 2000 UTC vs.
Revision 1.6 by tdb, Fri Jan 12 00:45:25 2001 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines