@Override
    public void contextInitialized(ServletContextEvent event) {
        if (XMPPServer.getInstance() != null) {
            // Running in standalone mode so do nothing
            return;
        }
        XMPPServer server = new XMPPServer();
        event.getServletContext().setAttribute(XMPP_KEY, server);
    }
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