Commit 80ff1df7 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

More clustering optimizations. Avoid using invocation service and rely on caches instead.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches/openfire_3_5_1@10245 b35dd754-fafc-0310-a699-88a17e54d16e
parent 48d6f930
......@@ -37,6 +37,8 @@ public class ClientSessionInfo implements Externalizable {
private Presence presence;
private String defaultList;
private String activeList;
private int conflictCount;
private boolean offlineFloodStopped;
public ClientSessionInfo() {
}
......@@ -45,6 +47,8 @@ public class ClientSessionInfo implements Externalizable {
presence = session.getPresence();
defaultList = session.getDefaultList() != null ? session.getDefaultList().getName() : null;
activeList = session.getActiveList() != null ? session.getActiveList().getName() : null;
conflictCount = session.getConflictCount();
offlineFloodStopped = session.isOfflineFloodStopped();
}
public Presence getPresence() {
......@@ -59,6 +63,14 @@ public class ClientSessionInfo implements Externalizable {
return activeList;
}
public int getConflictCount() {
return conflictCount;
}
public boolean isOfflineFloodStopped() {
return offlineFloodStopped;
}
public void writeExternal(ObjectOutput out) throws IOException {
ExternalizableUtil.getInstance().writeSerializable(out, (DefaultElement) presence.getElement());
ExternalizableUtil.getInstance().writeBoolean(out, defaultList != null);
......@@ -69,6 +81,8 @@ public class ClientSessionInfo implements Externalizable {
if (activeList != null) {
ExternalizableUtil.getInstance().writeSafeUTF(out, activeList);
}
ExternalizableUtil.getInstance().writeInt(out, conflictCount);
ExternalizableUtil.getInstance().writeBoolean(out, offlineFloodStopped);
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
......@@ -80,5 +94,7 @@ public class ClientSessionInfo implements Externalizable {
if (ExternalizableUtil.getInstance().readBoolean(in)) {
activeList = ExternalizableUtil.getInstance().readSafeUTF(in);
}
conflictCount = ExternalizableUtil.getInstance().readInt(in);
offlineFloodStopped = ExternalizableUtil.getInstance().readBoolean(in);
}
}
......@@ -640,6 +640,11 @@ public class LocalClientSession extends LocalSession implements ClientSession {
*/
public void setOfflineFloodStopped(boolean offlineFloodStopped) {
this.offlineFloodStopped = offlineFloodStopped;
if (ClusterManager.isClusteringStarted()) {
// Track information about the session and share it with other cluster nodes
Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
cache.put(getAddress().toString(), new ClientSessionInfo(this));
}
}
/**
......@@ -747,6 +752,11 @@ public class LocalClientSession extends LocalSession implements ClientSession {
*/
public void incrementConflictCount() {
conflictCount++;
if (ClusterManager.isClusteringStarted()) {
// Track information about the session and share it with other cluster nodes
Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
cache.put(getAddress().toString(), new ClientSessionInfo(this));
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment