Author: borges
Date: 2012-01-09 06:19:04 -0500 (Mon, 09 Jan 2012)
New Revision: 12004
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageImpl.java
Log:
Make address synchronization consistent
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageImpl.java 2012-01-09
11:18:48 UTC (rev 12003)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageImpl.java 2012-01-09
11:19:04 UTC (rev 12004)
@@ -52,12 +52,12 @@
private static final Logger log = Logger.getLogger(MessageImpl.class);
public static final SimpleString HDR_ROUTE_TO_IDS = new
SimpleString("_HQ_ROUTE_TO");
-
- // used by the bridges to set duplicates
+
+ // used by the bridges to set duplicates
public static final SimpleString HDR_BRIDGE_DUPLICATE_ID = new
SimpleString("_HQ_BRIDGE_DUP");
public static final int BUFFER_HEADER_SPACE = PacketImpl.PACKET_HEADERS_SIZE;
-
+
public static final int BODY_OFFSET = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT;
@@ -91,7 +91,7 @@
private boolean copied = true;
private boolean bufferUsed;
-
+
private UUID userID;
// Constructors --------------------------------------------------
@@ -201,7 +201,7 @@
{
return DataConstants.SIZE_LONG + // Message ID
DataConstants.SIZE_BYTE + // user id null?
- (userID == null ? 0 : 16) +
+ (userID == null ? 0 : 16) +
/* address */SimpleString.sizeofNullableString(address) +
DataConstants./* Type */SIZE_BYTE +
DataConstants./* Durable */SIZE_BOOLEAN +
@@ -210,8 +210,8 @@
DataConstants./* Priority */SIZE_BYTE +
/* PropertySize and Properties */properties.getEncodeSize();
}
-
+
public void encodeHeadersAndProperties(final HornetQBuffer buffer)
{
buffer.writeLong(messageID);
@@ -254,7 +254,7 @@
priority = buffer.readByte();
properties.decode(buffer);
}
-
+
public void copyHeadersAndProperties(final MessageInternal msg)
{
messageID = msg.getMessageID();
@@ -267,7 +267,7 @@
priority = msg.getPriority();
properties = msg.getTypedProperties();
}
-
+
public HornetQBuffer getBodyBuffer()
{
if (bodyBuffer == null)
@@ -282,18 +282,18 @@
{
return messageID;
}
-
+
public UUID getUserID()
{
return userID;
}
-
+
public void setUserID(final UUID userID)
{
this.userID = userID;
}
- public SimpleString getAddress()
+ public synchronized SimpleString getAddress()
{
return address;
}
@@ -502,7 +502,7 @@
return buffer;
}
}
-
+
public void setAddressTransient(final SimpleString address)
{
this.address = address;
@@ -574,7 +574,7 @@
bufferValid = false;
}
-
+
public void putObjectProperty(final SimpleString key, final Object value) throws
PropertyConversionException
{
if (value == null)
@@ -815,7 +815,7 @@
{
return properties.getSimpleStringProperty(new SimpleString(key));
}
-
+
public Object getObjectProperty(final String key)
{
return properties.getProperty(new SimpleString(key));
@@ -859,7 +859,7 @@
{
return new DecodingContext();
}
-
+
public TypedProperties getTypedProperties()
{
return this.properties;