fShutdownHook = new Thread() {
@Override
public void run() {
/* Shutdown UI */
SafeRunner.run(new LoggingSafeRunnable() {
public void run() throws Exception {
Controller.getDefault().shutdown(true);
}
});
/* Shutdown Core */
SafeRunner.run(new LoggingSafeRunnable() {
public void run() throws Exception {
Owl.getPersistenceService().shutdown(true);
}
});
}
};
fShutdownHook.setPriority(Thread.MAX_PRIORITY);
Runtime.getRuntime().addShutdownHook(fShutdownHook);
/* Activate the Core Bundle */
SafeRunner.run(new LoggingSafeRunnable() {
public void run() throws Exception {
startCore();
}
});
/* Propagate startup to Controller */
SafeRunner.run(new LoggingSafeRunnable() {
public void run() throws Exception {
Controller.getDefault().startup();
}
});
/* Propagate post-ui startup to Controller */
SafeRunner.run(new LoggingSafeRunnable() {
public void run() throws Exception {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
Controller.getDefault().postUIStartup();
}