use of com.haulmont.cuba.core.sys.events.AppContextStoppedEvent in project cuba by cuba-platform.
the class AppContext method stopContext.
/**
* Called by the framework right before the application shutdown.
*/
static void stopContext() {
if (!started)
return;
started = false;
for (int i = listeners.size() - 1; i >= 0; i--) {
Listener listener = listeners.get(i);
listener.applicationStopped();
}
Events events = (Events) getApplicationContext().getBean(Events.NAME);
events.publish(new AppContextStoppedEvent(context));
if (context != null && context instanceof ConfigurableApplicationContext) {
((ConfigurableApplicationContext) context).close();
}
}
Aggregations