Author: pferraro
Date: 2008-10-06 14:40:04 -0400 (Mon, 06 Oct 2008)
New Revision: 1936
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ModClusterService.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java
Log:
Rollback mutable server states - add new drm entry constructor accepting jvm routes.
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/ModClusterService.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/ModClusterService.java 2008-10-06
07:51:14 UTC (rev 1935)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/ModClusterService.java 2008-10-06
18:40:04 UTC (rev 1936)
@@ -453,17 +453,12 @@
throw Utils.convertToUnchecked(e);
}
}
-
- void updateLocalDRMEntry()
- {
- this.updateLocalDRM(this.drmEntry);
- }
- void updateLocalDRM(ModClusterServiceDRMEntry ourNewStatus)
+ void updateLocalDRM(ModClusterServiceDRMEntry status)
{
try
{
-
this.getHAPartition().getDistributedReplicantManager().add(this.getHAServiceKey(),
ourNewStatus);
+
this.getHAPartition().getDistributedReplicantManager().add(this.getHAServiceKey(),
status);
}
catch (Exception e)
{
@@ -564,9 +559,7 @@
{
try
{
- oldStatus.setMCMPServerStates(newStatus.getMCMPServerStates());
- drm.add(key, oldStatus);
-// drm.add(key, new ModClusterServiceDRMEntry(cn,
newStatus.getMCMPServerStates()));
+ drm.add(key, new ModClusterServiceDRMEntry(cn,
newStatus.getMCMPServerStates(), oldStatus.getJvmRoutes()));
}
catch (Exception e)
{
@@ -908,31 +901,21 @@
ClusterNode node = partition.getClusterNode();
boolean othersFirst =
this.coord.narrowCandidateList(allStatuses).contains(node);
- Set<MCMPServerState> oldStates =
this.coord.drmEntry.getMCMPServerStates();
- boolean updated = (oldStates != null) ? !oldStates.equals(masterList) :
oldStates != masterList;
-// ModClusterServiceDRMEntry ourNewStatus = new ModClusterServiceDRMEntry(node,
masterList);
-// boolean updated = !ourNewStatus.equals(ourCurrentStatus);
+ ModClusterServiceDRMEntry newStatus = new ModClusterServiceDRMEntry(node,
masterList, this.coord.drmEntry.getJvmRoutes());
+ boolean updated = !newStatus.equals(ourCurrentStatus);
if (othersFirst)
{
this.coord.clusterStatusComplete(statuses);
-
- if (updated)
- {
- this.coord.drmEntry.setMCMPServerStates(masterList);
- this.coord.updateLocalDRMEntry();
-// this.coord.updateLocalDRM(ourNewStatus);
- }
}
- else
+
+ if (updated)
{
- if (updated)
- {
- this.coord.drmEntry.setMCMPServerStates(masterList);
- this.coord.updateLocalDRMEntry();
-// this.coord.updateLocalDRM(ourNewStatus);
- }
-
+ this.coord.updateLocalDRM(newStatus);
+ }
+
+ if (!othersFirst)
+ {
this.coord.clusterStatusComplete(statuses);
}
}
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java 2008-10-06
07:51:14 UTC (rev 1935)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java 2008-10-06
18:40:04 UTC (rev 1936)
@@ -46,10 +46,15 @@
private final Integer establishedCount;
private final Integer healthyCount;
private final Integer knownCount;
- private final Set<String> jvmRoutes = new HashSet<String>();
+ private final Set<String> jvmRoutes;
public ModClusterServiceDRMEntry(ClusterNode peer, Set<MCMPServerState>
mcmpServerStates)
{
+ this(peer, mcmpServerStates, new HashSet<String>());
+ }
+
+ public ModClusterServiceDRMEntry(ClusterNode peer, Set<MCMPServerState>
mcmpServerStates, Set<String> jvmRoutes)
+ {
assert peer != null : "peer is null";
this.peer = peer;
@@ -85,6 +90,7 @@
this.healthyCount = Integer.valueOf(healthy);
this.healthyEstablishedCount = Integer.valueOf(healthyEstablished);
this.knownCount = Integer.valueOf(known);
+ this.jvmRoutes = jvmRoutes;
}
public ClusterNode getPeer()
@@ -92,11 +98,6 @@
return this.peer;
}
- public void setMCMPServerStates(Set<MCMPServerState> states)
- {
- this.mcmpServerStates = states;
- }
-
public Set<MCMPServerState> getMCMPServerStates()
{
return this.mcmpServerStates;
Show replies by date