public boolean isRemote( JID jid )
    {
        return jid != null
                && !jid.getDomain().equals( xmppServerInfo.getXMPPDomain() )
                && !componentManager.hasComponent( new JID(null, jid.getDomain(), null, true) );
    }
Returns true if the domain-part of the given address does not match the local server hostname and does not
match a component service JID

@param jid the JID to check.
@return true if the given address does not match the local server hostname and does not
        match a component service JID.
xmppserver/src/main/java/org/jivesoftware/openfire/XMPPServer.java