private static void stopAndDestroyModule( final Module module ) {
        try {
            logger.debug("Stopping and shutting down module '{}'", module.getName() );
            module.stop();
            module.destroy();
        } catch (Exception ex) {
            logger.error("Exception during module '{}' shutdown", module.getName(), ex);
        }
    }
Stops and destroys a module.

@param module The module to be stopped (cannot be null).
xmppserver/src/main/java/org/jivesoftware/openfire/XMPPServer.java