this.properties = properties;
}
/** Starts the application, throwing an exception on failure. */
public void run() throws Exception {
DataService dataService =
Kernel.proxy.getService(DataService.class);
try {
// test to see if this name if the listener is already bound...
dataService.getServiceBinding(StandardProperties.APP_LISTENER);
} catch (NameNotBoundException nnbe) {
// ...if it's not, create and then bind the listener
AppListener listener =
(new PropertiesWrapper(properties)).
getClassInstanceProperty(StandardProperties.APP_LISTENER,
AppListener.class, new Class[] {});
if (listener instanceof ManagedObject) {
dataService.setServiceBinding(
StandardProperties.APP_LISTENER, listener);
} else {
dataService.setServiceBinding(
StandardProperties.APP_LISTENER,
new ManagedSerializable<AppListener>(listener));
}
// since we created the listener, we're the first one to