public void setPort( int port )
    {
        final long oldPort = getPort();
        if (port == oldPort ) {
            Log.debug( "Ignoring port change request (to '{}'): listener already in this state.", port );
            return;
        }

        Log.debug( "Changing port from '{}' to '{}'.", oldPort, port );
        if ( tcpPortPropertyName != null )
        {
            JiveGlobals.setProperty( tcpPortPropertyName, String.valueOf( port ) );
        }
        restart();
    }
Changes the TCP port on which connections are accepted, This configuration change is persisted.

If the listener is currently enabled, this configuration change will be applied immediately (which will cause a
restart of the underlying connection acceptor).

An invocation of this method has no effect if the new port value is equal to the existing value.

@param port A port number.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/ConnectionListener.java