[hornetq-commits] JBoss hornetq SVN: r10812 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Jun 15 12:52:17 EDT 2011
Author: clebert.suconic at jboss.com
Date: 2011-06-15 12:52:17 -0400 (Wed, 15 Jun 2011)
New Revision: 10812
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
Log:
fixing test
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-06-15 15:15:58 UTC (rev 10811)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-06-15 16:52:17 UTC (rev 10812)
@@ -847,7 +847,10 @@
return;
}
- log.debug("Calling close on session " + this);
+ if (log.isDebugEnabled())
+ {
+ log.debug("Calling close on session " + this);
+ }
try
{
@@ -1095,13 +1098,19 @@
public void addMetaDataV1(String key, String data) throws HornetQException
{
- metadata.put(key, data);
+ synchronized (metadata)
+ {
+ metadata.put(key, data);
+ }
channel.sendBlocking(new SessionAddMetaDataMessage(key, data));
}
public void addMetaData(String key, String data) throws HornetQException
{
- metadata.put(key, data);
+ synchronized (metadata)
+ {
+ metadata.put(key, data);
+ }
channel.sendBlocking(new SessionAddMetaDataMessageV2(key, data));
}
@@ -1617,12 +1626,23 @@
public String toString()
{
StringBuffer buffer = new StringBuffer();
- for (Map.Entry<String, String> entry : metadata.entrySet())
+ synchronized (metadata)
{
- buffer.append(entry.getKey() + "=" + entry.getValue() + ",");
+ for (Map.Entry<String, String> entry : metadata.entrySet())
+ {
+ buffer.append(entry.getKey() + "=" + entry.getValue() + ",");
+ }
}
-
- return "ClientSessionImpl [name=" + name + ", username=" + username + ", closed=" + closed + " metaData=(" + buffer + ")]@" + Integer.toHexString(hashCode()) ;
+
+ return "ClientSessionImpl [name=" + name +
+ ", username=" +
+ username +
+ ", closed=" +
+ closed +
+ " metaData=(" +
+ buffer +
+ ")]@" +
+ Integer.toHexString(hashCode());
}
// Protected
More information about the hornetq-commits
mailing list