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/CorbaClientListenerServant.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/clientinterface/CorbaClientListenerServant.java (file contents):
Revision 1.3 by tdb, Sat Feb 3 04:47:49 2001 UTC vs.
Revision 1.6 by tdb, Wed Feb 28 19:04:00 2001 UTC

# Line 9 | Line 9 | import uk.ac.ukc.iscream.client.*;
9  
10   /**
11   * This class, a servant, listens for incoming connections from CORBA based
12 < * clients. Once it receives a connection it creates and assigns a CorbaHandler
13 < * object to it. The CorbaHandler will then handle all requests on behalf of the
12 > * clients. Once it receives a connection it creates and assigns a CorbaControlHandler
13 > * object to it. The CorbaControlHandler will then handle all requests on behalf of the
14   * client, and will send the client data.
15   *
16   * @author  $Author$
# Line 33 | Line 33 | class CorbaClientListenerServant extends CorbaClientLi
33       * Creates a new CorbaClientListenerServant.
34       *
35       * @param packetSorter a reference to the PacketSorter object being used
36 +     * @param queueMonitorInterval the interval at which to monitor the Queue
37       */
38 <    public CorbaClientListenerServant(PacketSorter packetSorter) {
38 >    public CorbaClientListenerServant(PacketSorter packetSorter, int queueMonitorInterval) {
39          _packetSorter = packetSorter;
40 +        _queueMonitorInterval = queueMonitorInterval;
41          _logger.write(toString(), Logger.SYSINIT, "created");
42      }
43      
# Line 44 | Line 46 | class CorbaClientListenerServant extends CorbaClientLi
46      /**
47       * Allows a CORBA client to connect to the server.
48       *
47     * @param name the name of the connecting client.
49       * @param client a reference to the "servant" part of the connecting client.
50 <     * @return a CorbaHandler reference.
50 >     * @param name a name to identify the client.
51 >     * @return a CorbaControlHandler reference.
52       */
53 <    public CorbaHandler connect(String name, Client client) {
54 <        CorbaHandlerServant chServant = new CorbaHandlerServant(_packetSorter, name, client);
53 <        CorbaHandlerPOATie chPOATie = new CorbaHandlerPOATie(chServant);
53 >    public CorbaControlHandler connect(Client client, String name) {
54 >        CorbaControlHandlerServant cchServant = new CorbaControlHandlerServant(_packetSorter, client, _queueMonitorInterval, name);
55          org.omg.CORBA.Object objRef;
56          try {
57 <            objRef = _refman.getRootPOA().servant_to_reference(chPOATie);
57 >            objRef = _refman.getRootPOA().servant_to_reference(cchServant);
58          } catch (Exception e) {
59              objRef = null;
60 <            _logger.write(toString(), Logger.ERROR, "Error creating CorbaHandler: "+e);
60 >            _logger.write(toString(), Logger.ERROR, "Error creating CorbaControlHandler: "+e);
61          }
62 <        CorbaHandler corbaHandler = CorbaHandlerHelper.narrow(objRef);
62 <        ((Thread) corbaHandler).start();
62 >        CorbaControlHandler corbaHandler = CorbaControlHandlerHelper.narrow(objRef);
63          return corbaHandler;
64      }
65      
# Line 111 | Line 111 | class CorbaClientListenerServant extends CorbaClientLi
111       * A reference to the PacketSorter.
112       */
113      private PacketSorter _packetSorter;
114 +    
115 +    /**
116 +     * The interval at which to monitor Queues.
117 +     */
118 +    private int _queueMonitorInterval;
119      
120   //---STATIC ATTRIBUTES---
121  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines