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

Comparing projects/cms/source/server/uk/org/iscream/cms/server/clientinterface/ClientInterfaceMain.java (file contents):
Revision 1.4 by ajm, Wed Dec 13 12:57:38 2000 UTC vs.
Revision 1.14 by tdb, Sun Jan 28 05:57:29 2001 UTC

# Line 2 | Line 2
2   package uk.ac.ukc.iscream.clientinterface;
3  
4   //---IMPORTS---
5 < import uk.ac.ukc.iscream.util.*;
5 > import uk.ac.ukc.iscream.componentmanager.*;
6   import uk.ac.ukc.iscream.core.*;
7 + import uk.ac.ukc.iscream.util.*;
8  
9   /**
10   * This class starts the real time clients
# Line 15 | Line 16 | import uk.ac.ukc.iscream.core.*;
16   * @author  $Author$
17   * @version $Id$
18   */
19 < public class ClientInterfaceMain implements uk.ac.ukc.iscream.util.Component {
19 > public class ClientInterfaceMain implements Component {
20  
21   //---FINAL ATTRIBUTES---
22  
# Line 43 | Line 44 | public class ClientInterfaceMain implements uk.ac.ukc.
44          
45          Configuration config = _refman.getCM().getConfiguration("ClientInterface");
46          if (config == null) {
47 <            System.err.println("CRITICAL:Unable to obtain configuration" +
48 <                               "\n         Advise you check the i-scream log for more information.");
49 <            _logger.write(toString(), Logger.FATAL, "ERROR - unable to obtain configuration");
49 <            System.exit(1);
50 <        } else {
47 >            thrown new ComponentStartException("Unable to obtain configuration for component");
48 >        }
49 >        else {
50              try {
51 +                // get the configuration properties we need
52                  ourName = config.getProperty("RootFilter.realtimeInterfaceName");
53                  listenPort = Integer.parseInt(config.getProperty("ClientInterface.listenPort"));
54              } catch (org.omg.CORBA.MARSHAL e) {
55 <                System.err.println ("CRITICAL:Unable to obtain required configuration property" +
56 <                                    "\n         Advise you check the i-scream log for more information.");
57 <                _logger.write(toString(), Logger.FATAL, "ERROR - required configuration property not present");
58 <                System.exit(1);
59 <
55 >                thrown new ComponentStartException("Unable to obtain requried configuration property for component");
56              }
57          }
58 +        
59          // now we have the name of the interface we set it
60          NAME = ourName;
61          
62          _logger.write(toString(), Logger.SYSINIT, "configured");
63 <                
63 >        
64 >        // Setup a PacketSorter
65 >        PacketSorter ps = new PacketSorter();
66 >        ps.start();
67 >        
68          // ClientInterfaceServant start (for inbound data)
69          _logger.write(toString(), Logger.DEBUG, "starting servant for inbound data");
70 <        ClientInterfaceServant ciServant = new ClientInterfaceServant();
70 >        ClientInterfaceServant ciServant = new ClientInterfaceServant(ps);
71          _refman.bindToOrb(ciServant, "iscream.ClientInterface." + ClientInterfaceMain.NAME);
72          
73 <        ClientListener clientListener = new ClientListener(listenPort, ciServant);
74 <        clientListener.start();
73 >        // Startup the TCPListener
74 >        TCPClientListener tcpClientListener = new TCPClientListener(listenPort, ps);
75 >        tcpClientListener.start();
76          
77          _logger.write(toString(), Logger.SYSINIT, "started");
78      }
# Line 86 | Line 88 | public class ClientInterfaceMain implements uk.ac.ukc.
88       */
89      public String toString() {
90          return FormatName.getName(
91 <            _name,
91 >            NAME,
92              getClass().getName(),
93              REVISION);
94      }
# Line 96 | Line 98 | public class ClientInterfaceMain implements uk.ac.ukc.
98   //---ACCESSOR/MUTATOR METHODS---
99  
100   //---ATTRIBUTES---
99
100    /**
101     * This is the friendly identifier of the
102     * component this class is running in.
103     * eg, a Filter may be called "filter1",
104     * If this class does not have an owning
105     * component,  a name from the configuration
106     * can be placed here.  This name could also
107     * be changed to null for utility classes.
108     */
109    private String _name = ClientInterfaceMain.NAME;
101  
102      /**
103       * This holds a reference to the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines