Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put(EventConstants.EVENT_TOPIC, "efxapp/applicationLaunched");
Activator.getContext().registerService(EventHandler.class, handler, properties);
ServiceReference<ApplicationDescriptor> ref = col.iterator().next();
final ApplicationDescriptor desc = Activator.getContext().getService(ref);
new Thread() {
public void run() {
try {
Map<String, Object> test = new HashMap<String, Object>();
if (!brandingArgs.isEmpty()) {
test.put(IApplicationContext.APPLICATION_ARGS, brandingArgs.toArray(new String[0]));
}
desc.launch(test);
} catch (ApplicationException e) {
System.err.println("Failed to launch application '" + applicationId + "'");
e.printStackTrace();
}
}