Author: clebert.suconic(a)jboss.com
Date: 2011-11-22 10:46:34 -0500 (Tue, 22 Nov 2011)
New Revision: 11739
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/ClusterConnection.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
https://issues.jboss.org/browse/JBPAPP-7535 - Fixing topology for the colocated backup
case
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2011-11-22
07:23:59 UTC (rev 11738)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java 2011-11-22
15:46:34 UTC (rev 11739)
@@ -177,17 +177,16 @@
return "Remote Proxy on channel " +
Integer.toHexString(System.identityHashCode(this));
}
};
-
- final boolean isCC = msg.isClusterConnection();
+
if (acceptorUsed.getClusterConnection() != null)
{
-
acceptorUsed.getClusterConnection().addClusterTopologyListener(listener, isCC);
+
acceptorUsed.getClusterConnection().addClusterTopologyListener(listener);
rc.addCloseListener(new CloseListener()
{
public void connectionClosed()
{
-
acceptorUsed.getClusterConnection().removeClusterTopologyListener(listener, isCC);
+
acceptorUsed.getClusterConnection().removeClusterTopologyListener(listener);
}
});
}
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/ClusterConnection.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/ClusterConnection.java 2011-11-22
07:23:59 UTC (rev 11738)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/ClusterConnection.java 2011-11-22
15:46:34 UTC (rev 11739)
@@ -42,9 +42,9 @@
void nodeAnnounced(long eventUID, String nodeID, Pair<TransportConfiguration,
TransportConfiguration> connectorPair, boolean backup);
- void addClusterTopologyListener(ClusterTopologyListener listener, boolean
clusterConnection);
+ void addClusterTopologyListener(ClusterTopologyListener listener);
- void removeClusterTopologyListener(ClusterTopologyListener listener, boolean
clusterConnection);
+ void removeClusterTopologyListener(ClusterTopologyListener listener);
/**
* @return a Map of node ID and addresses
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-11-22
07:23:59 UTC (rev 11738)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-11-22
15:46:34 UTC (rev 11739)
@@ -246,7 +246,7 @@
clusterConnector = new StaticClusterConnector(tcConfigs);
- backupServerLocator = clusterConnector.createServerLocator(false);
+ backupServerLocator = clusterConnector.createServerLocator();
if (backupServerLocator != null)
{
@@ -356,7 +356,7 @@
clusterConnector = new DiscoveryClusterConnector(dg);
- backupServerLocator = clusterConnector.createServerLocator(true);
+ backupServerLocator = clusterConnector.createServerLocator();
if (backupServerLocator != null)
{
@@ -507,7 +507,7 @@
return topology.getMember(manager.getNodeId());
}
- public void addClusterTopologyListener(final ClusterTopologyListener listener, final
boolean clusterConnection)
+ public void addClusterTopologyListener(final ClusterTopologyListener listener)
{
topology.addClusterTopologyListener(listener);
@@ -515,7 +515,7 @@
topology.sendTopology(listener);
}
- public void removeClusterTopologyListener(final ClusterTopologyListener listener,
final boolean clusterConnection)
+ public void removeClusterTopologyListener(final ClusterTopologyListener listener)
{
topology.removeClusterTopologyListener(listener);
}
@@ -642,7 +642,7 @@
backupServerLocator = null;
}
- serverLocator = clusterConnector.createServerLocator(true);
+ serverLocator = clusterConnector.createServerLocator();
if (serverLocator != null)
{
@@ -680,7 +680,7 @@
this.serverLocator.setRetryInterval(retryInterval);
}
- serverLocator.addClusterTopologyListener(this);
+ addClusterTopologyListener(this);
serverLocator.setAfterConnectionInternalListener(this);
@@ -1567,7 +1567,7 @@
interface ClusterConnector
{
- ServerLocatorInternal createServerLocator(boolean includeTopology);
+ ServerLocatorInternal createServerLocator();
}
private class StaticClusterConnector implements ClusterConnector
@@ -1579,7 +1579,7 @@
this.tcConfigs = tcConfigs;
}
- public ServerLocatorInternal createServerLocator(boolean includeTopology)
+ public ServerLocatorInternal createServerLocator()
{
if (tcConfigs != null && tcConfigs.length > 0)
{
@@ -1587,7 +1587,7 @@
{
log.debug(ClusterConnectionImpl.this + "Creating a serverLocator for
" + Arrays.toString(tcConfigs));
}
- ServerLocatorImpl locator = new ServerLocatorImpl(includeTopology ? topology
: null, true, tcConfigs);
+ ServerLocatorImpl locator = new ServerLocatorImpl(topology, true,
tcConfigs);
locator.setClusterConnection(true);
return locator;
}
@@ -1617,9 +1617,9 @@
this.dg = dg;
}
- public ServerLocatorInternal createServerLocator(boolean includeTopology)
+ public ServerLocatorInternal createServerLocator()
{
- ServerLocatorImpl locator = new ServerLocatorImpl(includeTopology ? topology :
null, true, dg);
+ ServerLocatorImpl locator = new ServerLocatorImpl(topology, true, dg);
return locator;
}