Long eventId = this.getCOMServices().getEventService().generateAndStoreEvent(
AppsLauncherHelper.STOPPING_OBJECT_TYPE,
ConfigurationProviderSingleton.getDomain(),
null);
final URI uri = this.getCOMServices().getEventService().getConnectionProvider().getConnectionDetails().getProviderURI();
this.getCOMServices().getEventService().publishEvent(uri, eventId,
AppsLauncherHelper.STOPPING_OBJECT_TYPE, null, source, null);
} catch (IOException ex) {
Long eventId2 = this.getCOMServices().getEventService().generateAndStoreEvent(
AppsLauncherHelper.STOPPED_OBJECT_TYPE,
ConfigurationProviderSingleton.getDomain(),
this.getCOMServices().getEventService().publishEvent(uri, eventId2,
AppsLauncherHelper.STOPPED_OBJECT_TYPE, null, source, null);
} catch (IOException ex) {
this.getCOMServices().closeAll();