Author: clebert.suconic(a)jboss.com
Date: 2011-07-26 21:57:20 -0400 (Tue, 26 Jul 2011)
New Revision: 11048
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
Log:
fix
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-07-27
01:26:35 UTC (rev 11047)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-07-27
01:57:20 UTC (rev 11048)
@@ -1412,7 +1412,7 @@
SimpleString nodeID = msg.getNodeID();
if (log.isTraceEnabled())
{
- log.trace("XXX notify nodeID=" + msg.getNodeID() + "
on serverLocator=" + serverLocator);
+ log.trace("XXX notifyDown nodeID=" + msg.getNodeID() +
" on serverLocator=" + serverLocator);
}
if (nodeID != null)
{
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-07-27
01:26:35 UTC (rev 11047)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-07-27
01:57:20 UTC (rev 11048)
@@ -65,6 +65,8 @@
private boolean finalizeCheck = true;
private boolean clusterConnection;
+
+ private String identity;
private final Set<ClusterTopologyListener> topologyListeners = new
HashSet<ClusterTopologyListener>();
@@ -1035,6 +1037,11 @@
throw new IllegalStateException("Cannot set attribute on SessionFactory
after it has been used");
}
}
+
+ public void setIdentity(String identity)
+ {
+ this.identity = identity;
+ }
public void setNodeID(String nodeID)
{
@@ -1168,14 +1175,14 @@
{
if (log.isDebugEnabled())
{
- log.debug("ignoring notifyNodeDown=" + nodeID + " as
isHA=false");
+ log.debug(this + "::ignoring notifyNodeDown=" + nodeID + " as
isHA=false");
}
return;
}
if (log.isDebugEnabled())
{
- log.debug("XXX " + this + "::Notify nodeID=" + nodeID +
" as being down");
+ log.debug("XXX YYY " + this + "::Notify nodeID=" + nodeID +
" as being down");
}
removed = topology.removeMember(nodeID);
@@ -1218,6 +1225,11 @@
return;
}
+ if (log.isDebugEnabled())
+ {
+ log.debug("XXX YYY " + this + "::notifyNodeUp " + nodeID +
", connctorPair=" + connectorPair);
+ }
+
topology.addMember(nodeID, new TopologyMember(connectorPair));
TopologyMember actMember = topology.getMember(nodeID);
@@ -1256,10 +1268,20 @@
@Override
public String toString()
{
- return "ServerLocatorImpl [initialConnectors=" +
Arrays.toString(initialConnectors) +
- ", discoveryGroupConfiguration=" +
- discoveryGroupConfiguration +
- "]";
+ if (clusterConnection)
+ {
+ return "ServerLocatorImpl (clusterConnection identity=" + identity +
") [initialConnectors=" + Arrays.toString(initialConnectors) +
+ ", discoveryGroupConfiguration=" +
+ discoveryGroupConfiguration +
+ "]";
+ }
+ else
+ {
+ return "ServerLocatorImpl [initialConnectors=" +
Arrays.toString(initialConnectors) +
+ ", discoveryGroupConfiguration=" +
+ discoveryGroupConfiguration +
+ "]";
+ }
}
private void updateArraysAndPairs()
@@ -1317,7 +1339,7 @@
topologyListeners.add(listener);
if (topology.members() > 0)
{
- log.debug("ServerLocatorImpl.addClusterTopologyListener");
+ log.debug(this + "::ServerLocatorImpl.addClusterTopologyListener");
}
}
@@ -1387,7 +1409,7 @@
{
if (log.isDebugEnabled())
{
- log.debug("Submitting connect towards " + conn);
+ log.debug(this + "::Submitting connect towards " + conn);
}
csf = conn.tryConnect();
@@ -1522,7 +1544,7 @@
{
if (log.isDebugEnabled())
{
- log.debug("Trying to connect to " + factory);
+ log.debug(this + "::Trying to connect to " + factory);
}
try
{
@@ -1531,7 +1553,7 @@
}
catch (HornetQException e)
{
- log.debug("Exception on establish connector initial connection",
e);
+ log.debug(this + "::Exception on establish connector initial
connection", e);
return null;
}
}
Modified:
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
===================================================================
---
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2011-07-27
01:26:35 UTC (rev 11047)
+++
branches/Branch_2_2_EAP_cluster_clean2/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2011-07-27
01:57:20 UTC (rev 11048)
@@ -32,6 +32,9 @@
void start(Executor executor) throws Exception;
void factoryClosed(final ClientSessionFactory factory);
+
+ /** Used to better identify Cluster Connection Locators on logs while debugging logs
*/
+ void setIdentity(String identity);
void setNodeID(String nodeID);
Show replies by date