90 |
|
objRef = orb.resolve_initial_references("NameService"); |
91 |
|
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef); |
92 |
|
|
93 |
+ |
// check we got it |
94 |
+ |
if (ncRef == null) { |
95 |
+ |
throw new Exception("Unable to locate CORBA Naming Service for configured ORB!"); |
96 |
+ |
} |
97 |
+ |
|
98 |
|
// start and bind each server in turn |
99 |
|
|
100 |
|
// work out which logger to use |
111 |
|
// get a reference to the servant as a Logger |
112 |
|
Logger logRef = LoggerHelper.narrow(objRef); |
113 |
|
|
109 |
– |
|
110 |
– |
|
114 |
|
// create the Configurator |
112 |
– |
String configLocation = System.getProperty("uk.ac.ukc.iscream.ConfigurationLocation", defaultConfigPath); |
115 |
|
ConfigurationManagerServant configManRef = new ConfigurationManagerServant(poa, logRef); |
116 |
|
|
117 |
|
// and advertise it to the naming context |
132 |
|
|
133 |
|
// there is already another CORE of the same name registered |
134 |
|
if ( e instanceof org.omg.CosNaming.NamingContextPackage.AlreadyBound) { |
135 |
< |
System.err.println("ERROR: Another I-Scream CORE is already registered under the same name."); |
135 |
> |
System.err.println("CORE ERROR: Another I-Scream CORE is already registered under the same name."); |
136 |
|
|
137 |
|
// otherwise we don't know what happened |
138 |
< |
// so print the error and do a stack trace |
138 |
> |
// so print the error and do a stack trace if debug is enabled |
139 |
|
} else { |
140 |
< |
System.err.println("CORE ERROR: " + e); |
141 |
< |
e.printStackTrace(System.out); |
140 |
> |
System.err.println("CORE ERROR: " + e.getMessage()); |
141 |
> |
if (Integer.parseInt(System.getProperty("uk.ac.ukc.iscream.Verbosity")) == Logger.DEBUG) { |
142 |
> |
System.err.println("*** DEBUG ENABLED - printing stack trace ***"); |
143 |
> |
e.printStackTrace(System.out); |
144 |
> |
} |
145 |
|
} |
146 |
|
} |
147 |
|
} |