public boolean isInitialized() {
        if (initialized == -1) {
            Presence presence = getPresence();
            if (presence != null && presence.isAvailable()) {
                // Optimization to avoid making a remote call
                initialized = 1;
            }
            else {
                ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.isInitialized);
                Object result = doSynchronousClusterTask(task);
                initialized = result != null && (Boolean) result ? 1 : 0;
            }
        }
        return initialized == 1;
    }
Surrogate for client sessions hosted in some remote cluster node.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/session/RemoteClientSession.java