| 116 |
|
} |
| 117 |
|
|
| 118 |
|
/** |
| 119 |
+ |
* Does a dependency check. Used mainly at startup to |
| 120 |
+ |
* see if the required dependencies (components) are up |
| 121 |
+ |
* and running. |
| 122 |
+ |
* |
| 123 |
+ |
* @return a boolean value, true if the depdencies are satisfied |
| 124 |
+ |
*/ |
| 125 |
+ |
public boolean depCheck() { |
| 126 |
+ |
try { |
| 127 |
+ |
org.omg.CORBA.Object obj; |
| 128 |
+ |
// first check the ConfigurationManager is alive |
| 129 |
+ |
obj = _refman.getCORBARef("iscream.ConfigurationManager"); |
| 130 |
+ |
// then get some info on the CLI and DBI |
| 131 |
+ |
ConfigurationProxy cp = ConfigurationProxy.getInstance(); |
| 132 |
+ |
String cli = cp.getProperty("RootFilter", "RootFilter.realtimeInterfaceName"); |
| 133 |
+ |
String dbi = cp.getProperty("RootFilter", "RootFilter.dbInterfaceName"); |
| 134 |
+ |
// finally check the CLI and DBI are alive |
| 135 |
+ |
obj = _refman.getCORBARef("iscream.ClientInterface." + cli); |
| 136 |
+ |
obj = _refman.getCORBARef("iscream.ClientInterface." + dbi); |
| 137 |
+ |
} catch(ComponentCORBAException e) { |
| 138 |
+ |
_logger.write(toString(), Logger.WARNING, "Dependency Failure: "+e); |
| 139 |
+ |
return false; |
| 140 |
+ |
} catch(PropertyNotFoundException e) { |
| 141 |
+ |
_logger.write(toString(), Logger.WARNING, "Unable to obtain configuration: "+e); |
| 142 |
+ |
return false; |
| 143 |
+ |
} |
| 144 |
+ |
// dependency check suceeded |
| 145 |
+ |
return true; |
| 146 |
+ |
} |
| 147 |
+ |
|
| 148 |
+ |
/** |
| 149 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
| 150 |
|
* method to provide clean logging (every class should have this). |
| 151 |
|
* |