use of com.peterphi.std.guice.common.shutdown.iface.ShutdownManager in project stdlib by petergeneric.
the class GuiceRegistry method stop.
/**
* Shutdown all services
*/
public synchronized void stop() {
if (injector != null) {
// Shutdown the services first
for (GuiceApplication service : services) {
try {
service.stopping();
} catch (Throwable t) {
log.warn("Error shutting down service " + service + ": " + t.getMessage(), t);
}
}
// Now shutdown the environment
ShutdownManager manager = injector.getInstance(ShutdownManager.class);
manager.shutdown();
// Allow the environment to be garbage collected
injector = null;
}
}
Aggregations