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.42 by tdb, Wed Feb 5 16:43:48 2003 UTC vs.
Revision 1.43 by tdb, Mon May 5 22:05:14 2003 UTC

# Line 74 | Line 74 | public class RootFilter implements Component {
74              _logger.write(toString(), Logger.WARNING, "RootFilter name not set: "+e);
75          }
76          
77        // try and get the names of the ciReal and ciDB
78        String realInterface, dbInterface;
79        // first realtime
80        try {
81            realInterface = cp.getProperty(configName, "RootFilter.realtimeInterfaceName");
82        } catch (PropertyNotFoundException e) {
83            _logger.write(toString(), Logger.DEBUG, "Optional config not set: "+e);
84            realInterface = null;
85        }
86        // next dbi
87        try {
88            dbInterface = cp.getProperty(configName, "RootFilter.dbInterfaceName");
89        } catch (PropertyNotFoundException e) {
90            _logger.write(toString(), Logger.DEBUG, "Optional config not set: "+e);
91            dbInterface = null;
92        }
93        
94        ClientInterface ciReal = null, ciDB = null;
95        // get reference to the client interfaces - the real time one
96        if (realInterface != null) {
97            ciReal = ClientInterfaceHelper.narrow(_refman.getCORBARef("iscream.ClientInterface\\." + realInterface));
98        }
99        // get reference to the client interfaces - and the db one
100        if (dbInterface != null) {
101            ciDB = ClientInterfaceHelper.narrow(_refman.getCORBARef("iscream.ClientInterface\\." + dbInterface));
102        }
103        
77          // setup a queue
78          Queue queue;
79          // see if this Queue needs a size limit
# Line 139 | Line 112 | public class RootFilter implements Component {
112              _logger.write(toString(), Logger.WARNING, "failed to find queue monitor config, disabling. " + e);
113          }
114          
142        if (realInterface != null && dbInterface != null) {
143            _logger.write(toString(), Logger.DEBUG, "hooked to interfaces - " + realInterface + " & " + dbInterface);
144            CIWrapper c = new CIWrapper(ciReal, queue);
145            c.start();
146            c = new CIWrapper(ciDB, queue);
147            c.start();
148        } else if (realInterface == null) {        
149            _logger.write(toString(), Logger.DEBUG, "hooked to interfaces - " + dbInterface);
150            CIWrapper c = new CIWrapper(ciDB, queue);
151            c.start();
152        } else if (dbInterface == null) {
153            _logger.write(toString(), Logger.DEBUG, "hooked to interfaces - " + realInterface);
154            CIWrapper c = new CIWrapper(ciReal, queue);
155            c.start();
156        } else {
157            _logger.write(toString(), Logger.WARNING, "not hooked to any client interfaces, this is probably not intentional!");
158        }
159                
115          // RootFilterServant start (for inbound child filter data)
116          _logger.write(toString(), Logger.DEBUG, "starting Root Filter");
117          RootFilterServant filterServant = new RootFilterServant(queue);
118          // bind to the naming service as a filter
119          _refman.bindToOrb(filterServant, "iscream.Filter\\." + RootFilter.NAME);
120          
121 +        // Startup the CORBA Listener
122 +        _logger.write(toString(), Logger.DEBUG, "starting servant for inbound clients");
123 +        CorbaClientListenerServant corbaServant = new CorbaClientListenerServant(queue);
124 +        _refman.bindToOrb(corbaServant, "iscream.ClientInterface\\." + RootFilter.NAME);
125 +        
126          _logger.write(toString(), Logger.SYSINIT, "started");
127          
128      }
# Line 186 | Line 146 | public class RootFilter implements Component {
146              return false;
147          }
148          
189        // next we need to check which client interfaces *should*
190        // be active, and check them. Note they do not have to
191        // be enabled, and we should check this.
192        // -- each check only forces a dependency if it's configured
193        ConfigurationProxy cp = ConfigurationProxy.getInstance();
194        // first check the client interface
195        try {
196            String cli = cp.getProperty("RootFilter", "RootFilter.realtimeInterfaceName");
197            obj = _refman.getCORBARef("iscream.ClientInterface\\." + cli);
198        } catch(ComponentCORBAException e) {
199            System.err.println(toString() + ": Dependency Failure: "+e);
200            return false;
201        } catch(PropertyNotFoundException e) {
202            System.err.println(toString() + ": Client interface not configured and thus not enabled.");
203        }
204        // second check the database interface
205        try {
206            String dbi = cp.getProperty("RootFilter", "RootFilter.dbInterfaceName");
207            obj = _refman.getCORBARef("iscream.ClientInterface\\." + dbi);
208        } catch(ComponentCORBAException e) {
209            System.err.println(toString() + ": Dependency Failure: "+e);
210            return false;
211        } catch(PropertyNotFoundException e) {
212            System.err.println(toString() + ": Database interface not configured and thus not enabled.");
213        }
214        
149          // dependency check suceeded
150          return true;
151      }
# Line 258 | Line 192 | public class RootFilter implements Component {
192       */
193      public static String NAME;
194  
195 < }            
195 > }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines