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.6 by tdb, Mon Jan 22 01:40:33 2001 UTC vs.
Revision 1.7 by tdb, Mon Jan 22 02:57:38 2001 UTC

# Line 10 | Line 10 | import java.util.Iterator;
10  
11   /**
12   * A client interface servant
13 < * This keeps a track of all connected clients to
14 < * the system and passes data to their handlers.
13 > * Adds data to a Queue as it's received over CORBA.
14   *
15   * Currently it has limited client management facilities.
16   *
# Line 34 | Line 33 | class ClientInterfaceServant extends ClientInterfacePO
33      /**
34       * Creates a new ClientInterfaceServant.
35       */
36 <    public ClientInterfaceServant() {
37 <        // here would be a nice place to pass in local clients
39 <        _clients  = new LinkedList();
36 >    public ClientInterfaceServant(Queue queue) {
37 >        _queue = queue;
38          _logger.write(toString(), Logger.SYSINIT, "created");
39      }
40      
# Line 48 | Line 46 | class ClientInterfaceServant extends ClientInterfacePO
46       * @param xml the String of XML to print out
47       */
48      public void receiveXML(String xml) {
49 <        Iterator i = _clients.iterator();
52 <        while(i.hasNext()) {
53 <            ((ClientDataHandler) i.next()).receiveXML(xml);
54 <        }
49 >        _queue.add(xml);
50      }
51      
52      /**
58     * Simply adds clients to a linked list
59     *
60     * @param newClient a reference to the client to add
61     */
62    public void register(ClientDataHandler newClient) {
63        _logger.write(toString(), Logger.SYSMSG, "registered client - " + newClient.toString());
64        _clients.add(newClient);
65    }
66    
67    /**
68     * Simply removes a client from a linked list
69     *
70     * @param client a reference to the client to be removed
71     */
72    public void deregister(ClientDataHandler client) {
73        _logger.write(toString(), Logger.SYSMSG, "deregistered client - " + client.toString());
74        _clients.remove(client);
75    }
76    
77    /**
53       * Overrides the {@link java.lang.Object#toString() Object.toString()}
54       * method to provide clean logging (every class should have this).
55       *
# Line 113 | Line 88 | class ClientInterfaceServant extends ClientInterfacePO
88       */
89      private Logger _logger = ReferenceManager.getInstance().getLogger();
90      
91 <    private LinkedList _clients;
91 >    private Queue _queue;
92      
93   //---STATIC ATTRIBUTES---
94  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines