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

Comparing projects/cms/source/server/uk/org/iscream/cms/server/clientinterface/ClientInterfaceServant.java (file contents):
Revision 1.5 by tdb, Thu Jan 18 23:07:00 2001 UTC vs.
Revision 1.8 by tdb, Tue Jan 23 16:56:31 2001 UTC

# Line 5 | Line 5 | package uk.ac.ukc.iscream.clientinterface;
5   import uk.ac.ukc.iscream.core.*;
6   import uk.ac.ukc.iscream.util.*;
7   import uk.ac.ukc.iscream.componentmanager.*;
8 import java.util.LinkedList;
9 import java.util.Iterator;
8  
9   /**
10   * A client interface servant
11 < * This keeps a track of all connected clients to
14 < * the system and passes data to their handlers.
11 > * Adds data to a Queue as it's received over CORBA.
12   *
16 * Currently it has limited client management facilities.
17 *
13   * @author  $Author$
14   * @version $Id$
15   */
# Line 34 | Line 29 | class ClientInterfaceServant extends ClientInterfacePO
29      /**
30       * Creates a new ClientInterfaceServant.
31       */
32 <    public ClientInterfaceServant() {
33 <        // here would be a nice place to pass in local clients
39 <        _clients  = new LinkedList();
32 >    public ClientInterfaceServant(PacketSorter ps) {
33 >        _queue = ps.getQueue();
34          _logger.write(toString(), Logger.SYSINIT, "created");
35      }
36      
# Line 48 | Line 42 | class ClientInterfaceServant extends ClientInterfacePO
42       * @param xml the String of XML to print out
43       */
44      public void receiveXML(String xml) {
45 <        Iterator i = _clients.iterator();
52 <        while(i.hasNext()) {
53 <            ((ClientHandler) i.next()).receiveXML(xml);
54 <        }
45 >        _queue.add(xml);
46      }
47      
48      /**
58     * Simply adds clients to a linked list
59     *
60     * @param newClient a reference to the client to add
61     */
62    public void register(ClientHandler newClient) {
63        _logger.write(toString(), Logger.SYSMSG, "registered client - " + newClient.toString());
64        _clients.add(newClient);
65    }
66    
67    /**
49       * Overrides the {@link java.lang.Object#toString() Object.toString()}
50       * method to provide clean logging (every class should have this).
51       *
# Line 103 | Line 84 | class ClientInterfaceServant extends ClientInterfacePO
84       */
85      private Logger _logger = ReferenceManager.getInstance().getLogger();
86      
87 <    private LinkedList _clients;
87 >    private Queue _queue;
88      
89   //---STATIC ATTRIBUTES---
90  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines