Author: clebert.suconic(a)jboss.com
Date: 2011-11-21 09:54:27 -0500 (Mon, 21 Nov 2011)
New Revision: 11726
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/Topology.java
Log:
Fix on Topology
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/Topology.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/Topology.java 2011-11-21
14:36:50 UTC (rev 11725)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/core/client/impl/Topology.java 2011-11-21
14:54:27 UTC (rev 11726)
@@ -60,7 +60,7 @@
*/
private final Map<String, TopologyMember> topology = new
ConcurrentHashMap<String, TopologyMember>();
- private transient final Map<String, Long> mapDelete = new
ConcurrentHashMap<String, Long>();
+ private transient Map<String, Long> mapDelete;
public Topology(final Object owner)
{
@@ -158,7 +158,7 @@
public boolean updateMember(final long uniqueEventID, final String nodeId, final
TopologyMember memberInput)
{
- Long deleteTme = mapDelete.get(nodeId);
+ Long deleteTme = getMapDelete().get(nodeId);
if (deleteTme != null && uniqueEventID < deleteTme)
{
log.debug("Update uniqueEvent=" + uniqueEventID +
@@ -306,7 +306,7 @@
}
else
{
- mapDelete.put(nodeId, uniqueEventID);
+ getMapDelete().put(nodeId, uniqueEventID);
member = topology.remove(nodeId);
}
}
@@ -536,4 +536,13 @@
}
}
+ private synchronized Map<String, Long> getMapDelete()
+ {
+ if (mapDelete == null)
+ {
+ mapDelete = new ConcurrentHashMap<String, Long>();
+ }
+ return mapDelete;
+ }
+
}