public Collection<ComponentSession> getComponentSessions() {
        List<ComponentSession> sessions = new ArrayList<>();
        // Add sessions of external components connected to this JVM
        sessions.addAll(localSessionManager.getComponentsSessions());
        // Add sessions of external components connected to other cluster nodes
        RemoteSessionLocator locator = server.getRemoteSessionLocator();
        if (locator != null) {
            for (Map.Entry<String, HashSet<NodeID>> entry : componentSessionsCache.entrySet()) {
                for (NodeID nodeID : entry.getValue()) {
                    if (!server.getNodeID().equals(nodeID)) {
                        sessions.add(locator.getComponentSession(nodeID.toByteArray(), new JID(entry.getKey())));
                    }
                }
            }
        }
        return sessions;
    }
Returns a collection with the established sessions from external components.

@return a collection with the established sessions from external components.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionManager.java