// Do not abort on error as init scripts handle this fine.
}
}
private static void doStartup() throws Exception {
final ServiceManager serviceManager = new GuicedServiceManager();
Main.shutdownBean = new ShutdownMXBeanImpl(serviceManager);
// JVM shutdown hook.
// Register before startServices() so services are still brought down on startup error.
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
shutdownBean.shutdown();
}
}, "ShutdownHook"));
// Bring system up
serviceManager.startServices();
ObjectName name = new ObjectName(ShutdownMXBeanImpl.BEAN_NAME);
ManagementFactory.getPlatformMBeanServer().registerMBean(shutdownBean, name);
}