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.21 by tdb, Fri Jan 19 01:20:15 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 +            try {
113 +                int q0 = queue.queueSize(0);
114 +                int q1 = queue.queueSize(1);
115 +                int tot = queue.elementCount();
116 +                String message = "Queue status - queue0: "+q0+" queue1: "+q1+" total: "+tot;
117 +                _logger.write(toString(), Logger.DEBUG, message);
118 +            }
119 +            catch(Exception e) {
120 +                _logger.write(toString(), Logger.ERROR, e.getMessage());
121 +            }
122 +        }
123      }
124      
125      /**
# Line 108 | Line 133 | public class RootFilter implements uk.ac.ukc.iscream.u
133       */
134      public String toString() {
135          return FormatName.getName(
136 <            _name,
136 >            NAME,
137              getClass().getName(),
138              REVISION);
139      }
# Line 118 | Line 143 | public class RootFilter implements uk.ac.ukc.iscream.u
143   //---ACCESSOR/MUTATOR METHODS---
144  
145   //---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;
146  
147      /**
148       * This holds a reference to the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines