private synchronized void stopListeners()
    {
        for ( final ConnectionListener listener : getListeners() )
        {
            // TODO determine by purpose exactly what needs and what need not be restarted.
            try
            {
                listener.stop();
            }
            catch ( RuntimeException ex )
            {
                Log.error( "An exception occurred while stopping listener " + listener, ex );
            }
        }

        // Stop the HTTP client listener.
        try
        {
            HttpBindManager.getInstance().stop();
        }
        catch ( RuntimeException ex )
        {
            Log.error( "An exception occurred while stopping HTTP Bind listener ", ex );
        }
    }
Stops all listeners. This ensures no listener will accept new connections.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/ConnectionManagerImpl.java