@Override
    public void contextDestroyed(ServletContextEvent event) {
        XMPPServer server = (XMPPServer) event.getServletContext().getAttribute(XMPP_KEY);
        if (null != server) {
            server.stop();
        }
    }
An XMPPContextListener starts an XMPPServer when a ServletContext is initialized and stops
the xmpp server when the servlet context is destroyed.

@author evrim ulu
@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/XMPPContextListener.java