public synchronized void enable( boolean enable )
    {
        // Not providing a property name indicates that availability cannot be toggled. The listener is 'always on'.
        if ( isEnabledPropertyName == null && !enable )
        {
            throw new IllegalArgumentException( "This listener cannot be disabled!" );
        }

        final boolean isRunning = connectionAcceptor != null;
        if ( enable == isRunning )
        {
            // This is likely to be caused by a cadence of property changes and harmless / safe to ignore.
            Log.debug( "Ignoring enable({}): listener already in this state.", enable );
            return;
        }

        JiveGlobals.setProperty( isEnabledPropertyName, Boolean.toString( enable ) );
        restart();
    }
Activates or deactivates the listener, and changes the configuration accordingly. This configuration change is
persisted. An invocation of this method has no effect if the listener is already in the provided state.
@param enable to enable or disable the listener
xmppserver/src/main/java/org/jivesoftware/openfire/spi/ConnectionListener.java