use of org.openmrs.api.db.ContextDAO in project openmrs-core by openmrs.
the class Context method shutdown.
/**
* Stops the OpenMRS System Should be called after all activity has ended and application is
* closing
*/
public static void shutdown() {
log.debug("Shutting down the scheduler");
try {
// Needs to be shutdown before Hibernate
SchedulerUtil.shutdown();
} catch (Exception e) {
log.warn("Error while shutting down scheduler service", e);
}
log.debug("Shutting down the modules");
try {
ModuleUtil.shutdown();
} catch (Exception e) {
log.warn("Error while shutting down module system", e);
}
log.debug("Shutting down the context");
try {
ContextDAO dao = null;
try {
dao = getContextDAO();
} catch (APIException e) {
// pass
}
if (dao != null) {
dao.shutdown();
}
} catch (Exception e) {
log.warn("Error while shutting down context dao", e);
}
}
Aggregations