public ComponentSession getComponentSession(String domain) {
        // Search in the external components connected to this JVM
        for (ComponentSession session : localSessionManager.getComponentsSessions()) {
            if (domain.equals(session.getAddress().getDomain())) {
                return session;
            }
        }
        // Search in the external components connected to other cluster nodes
        RemoteSessionLocator locator = server.getRemoteSessionLocator();
        if (locator != null) {
            Set<NodeID> nodeIDs = componentSessionsCache.get(domain);
            if (nodeIDs != null) {
                for (NodeID nodeID : nodeIDs ) {
                    // TODO Think of a better way to pick a component.
                    return locator.getComponentSession( nodeID.toByteArray(), new JID(domain) );
                }
            }
        }
        return null;
    }
Returns the session of the component whose domain matches the specified domain.

@param domain the domain of the component session to look for.
@return the session of the component whose domain matches the specified domain.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionManager.java