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

Comparing projects/cms/source/server/uk/org/iscream/cms/server/rootfilter/RootFilter.java (file contents):
Revision 1.11 by ajm, Tue Dec 12 20:44:03 2000 UTC vs.
Revision 1.18 by tdb, Fri Jan 19 01:12:42 2001 UTC

# Line 4 | Line 4 | package uk.ac.ukc.iscream.rootfilter;
4   //---IMPORTS---
5   import uk.ac.ukc.iscream.util.*;
6   import uk.ac.ukc.iscream.core.*;
7 + import uk.ac.ukc.iscream.componentmanager.*;
8   import uk.ac.ukc.iscream.clientinterface.*;
9  
10   /**
# Line 17 | Line 18 | import uk.ac.ukc.iscream.clientinterface.*;
18   * @author  $Author$
19   * @version $Id$
20   */
21 < public class RootFilter implements uk.ac.ukc.iscream.util.Component {
21 > public class RootFilter implements Component {
22  
23   //---FINAL ATTRIBUTES---
24  
# Line 66 | Line 67 | public class RootFilter implements uk.ac.ukc.iscream.u
67          NAME = ourName;
68          
69          _logger.write(toString(), Logger.SYSINIT, "configured");
70 <                
70 >        
71 >        ClientInterface ciReal = null, ciDB = null;
72          // get reference to the client interfaces - the real time one
73          if (realInterface != null) {
74 <            ClientInterface ciReal = ClientInterfaceHelper.narrow(_refman.getCORBARef("iscream.ClientInterface." + realInterface));
74 >            ciReal = ClientInterfaceHelper.narrow(_refman.getCORBARef("iscream.ClientInterface." + realInterface));
75          }
76          // get reference to the client interfaces - and the db one
77          if (dbInterface != null) {
78 <            ClientInterface ciDB = ClientInterfaceHelper.narrow(_refman.getCORBARef("iscream.ClientInterface." + dbInterface));
78 >            ciDB = ClientInterfaceHelper.narrow(_refman.getCORBARef("iscream.ClientInterface." + dbInterface));
79          }
80 <
81 <        ClientInterface[] clientInterfaces;
80 >        
81 >        Queue queue = new Queue();
82 >        
83          if (realInterface == null) {        
84              _logger.write(toString(), Logger.DEBUG, "hooked to interfaces - " + dbInterface);
85 <            clientInterfaces = {ciReal, ciDB};
85 >            CIWrapper c = new CIWrapper(ciDB, queue);
86 >            c.start();
87          } else if (dbInterface == null) {
88              _logger.write(toString(), Logger.DEBUG, "hooked to interfaces - " + realInterface);
89 <            clientInterfaces = {ciReal};
89 >            CIWrapper c = new CIWrapper(ciReal, queue);
90 >            c.start();
91          } else {
92              _logger.write(toString(), Logger.DEBUG, "hooked to interfaces - " + realInterface + " & " + dbInterface);
93 <            clientInterfaces = {ciReal, ciDB};
93 >            CIWrapper c = new CIWrapper(ciReal, queue);
94 >            c.start();
95 >            c = new CIWrapper(ciDB, queue);
96 >            c.start();
97          }
98 <        
98 >                
99          // RootFilterServant start (for inbound child filter data)
100          _logger.write(toString(), Logger.DEBUG, "starting Root Filter");
101 <        RootFilterServant filterServant = new RootFilterServant(clientInterfaces);
101 >        RootFilterServant filterServant = new RootFilterServant(queue);
102          // bind to the naming service as a filter
103 <        _refman.bindToOrb(filterServant, "iscream.Filter." + _name);
103 >        _refman.bindToOrb(filterServant, "iscream.Filter." + RootFilter.NAME);
104          
105          _logger.write(toString(), Logger.SYSINIT, "started");
106 +        
107 +        // !!!! TEMPORARY CODE !!!!
108 +        // Monitor the queue's status (queue 0 and 1 - big assumption!)
109 +        while(true) {
110 +            // wait 30 seconds
111 +            try { Thread.sleep(30000); } catch(Exception e) {}
112 +            int q0 = _queue.queueSize(0);
113 +            int q1 = _queue.queueSize(1);
114 +            int tot = _queue.elementCount();
115 +            String message = "Queue status - queue1: "+q1+" queue2: "+q2+" total: "+tot;
116 +            _logger.write(toString(), Logger.DEBUG, message);
117 +        }
118      }
119      
120      /**
# Line 108 | Line 128 | public class RootFilter implements uk.ac.ukc.iscream.u
128       */
129      public String toString() {
130          return FormatName.getName(
131 <            _name,
131 >            NAME,
132              getClass().getName(),
133              REVISION);
134      }
# Line 118 | Line 138 | public class RootFilter implements uk.ac.ukc.iscream.u
138   //---ACCESSOR/MUTATOR METHODS---
139  
140   //---ATTRIBUTES---
121
122    /**
123     * This is the friendly identifier of the
124     * component this class is running in.
125     * eg, a Filter may be called "filter1",
126     * If this class does not have an owning
127     * component,  a name from the configuration
128     * can be placed here.  This name could also
129     * be changed to null for utility classes.
130     */
131    private String _name = RootFilter.NAME;
141  
142      /**
143       * This holds a reference to the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines