Author: clebert.suconic(a)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
Show replies by date