public void destroy() {
try {
Object o = getServletConfig().getServletContext().getAttribute(SYNAPSE_SERVER_MANAGER);
if (o != null && o instanceof ServerManager) {
ServerManager serverManager = (ServerManager) o;
serverManager.stop();
getServletContext().removeAttribute(ALREADY_INITED);
}
} catch (Exception e) {
log.error("Error stopping the Synapse listener manager", e);
}