diff options
Diffstat (limited to 'java')
9 files changed, 136 insertions, 122 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java b/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java index 4361194dc3..6cf9fe6bf7 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java +++ b/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java @@ -121,6 +121,7 @@ public class AMQChannel //Why do we need this reference ? - ritchiem private final AMQProtocolSession _session; + private boolean _closing; public AMQChannel(AMQProtocolSession session, int channelId, TransactionManager transactionManager, MessageStore messageStore, MessageRouter exchanges) @@ -354,6 +355,7 @@ public class AMQChannel throws AMQException { + _closing = true; _txnContext.rollback(); unsubscribeAllConsumers(session); requeue(); @@ -966,4 +968,9 @@ public class AMQChannel { return _txnContext; } + + public boolean isClosing() + { + return _closing; + } } diff --git a/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java b/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java index bd5bb632fe..28b2489142 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java +++ b/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java @@ -77,7 +77,7 @@ public class ProtocolOutputConverterImpl implements ProtocolOutputConverter final AMQMessageHandle messageHandle = message.getMessageHandle();
final StoreContext storeContext = message.getStoreContext();
- final long messageId = message.getMessageId();
+ final Long messageId = message.getMessageId();
final int bodyCount = messageHandle.getBodyCount(storeContext,messageId);
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java index 3162efa183..d430f1af94 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java +++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java @@ -432,15 +432,16 @@ public class AMQMinaProtocolSession implements AMQProtocolSession, public AMQChannel getChannel(int channelId) throws AMQException { - if (channelAwaitingClosure(channelId)) + final AMQChannel channel = ((channelId & CHANNEL_CACHE_SIZE) == channelId) + ? _cachedChannels[channelId] + : _channelMap.get(channelId); + if (channel == null || channel.isClosing()) { return null; } else { - return ((channelId & CHANNEL_CACHE_SIZE) == channelId) - ? _cachedChannels[channelId] - : _channelMap.get(channelId); + return channel; } } diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java index 32c6eb2c9b..282569eed5 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java @@ -214,10 +214,6 @@ public class AMQMessage implements StorableMessage // _taken = new AtomicBoolean(false); - if (_log.isDebugEnabled()) - { - _log.debug("Message(" + System.identityHashCode(this) + ") created (" + debugIdentity() + ")"); - } } /** @@ -484,10 +480,10 @@ public class AMQMessage implements StorableMessage protected void incrementReference() { _referenceCount.incrementAndGet(); - if (_log.isDebugEnabled()) - { - _log.debug("Ref count on message " + debugIdentity() + " incremented " + Arrays.asList(Thread.currentThread().getStackTrace()).subList(3, 6)); - } +// if (_log.isDebugEnabled()) +// { +// _log.debug("Ref count on message " + debugIdentity() + " incremented " + Arrays.asList(Thread.currentThread().getStackTrace()).subList(3, 6)); +// } } /** @@ -512,10 +508,10 @@ public class AMQMessage implements StorableMessage { try { - if (_log.isDebugEnabled()) - { - _log.debug("Decremented ref count on message " + debugIdentity() + " is zero; removing message" + Arrays.asList(Thread.currentThread().getStackTrace()).subList(3, 6)); - } +// if (_log.isDebugEnabled()) +// { +// _log.debug("Decremented ref count on message " + debugIdentity() + " is zero; removing message" + Arrays.asList(Thread.currentThread().getStackTrace()).subList(3, 6)); +// } // must check if the handle is null since there may be cases where we decide to throw away a message // and the handle has not yet been constructed @@ -532,14 +528,6 @@ public class AMQMessage implements StorableMessage } } else { - if (_log.isDebugEnabled()) - { - _log.debug("Decremented ref count is now " + count + " for message id " + debugIdentity() + "\n" + Arrays.asList(Thread.currentThread().getStackTrace()).subList(3, 5)); - if (count < 0) - { - Thread.dumpStack(); - } - } if (count < 0) { throw new MessageCleanupException("Reference count for message id " + debugIdentity() + " has gone below 0."); diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java b/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java index 3bce950ba9..c496996002 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java @@ -322,17 +322,17 @@ public class SubscriptionImpl implements Subscription public boolean isSuspended() { - if (_suspensionlogger.isInfoEnabled()) - { - if (channel.isSuspended()) - { - _suspensionlogger.info("Subscription(" + debugIdentity() + ") channel's is susupended"); - } - if (_sendLock.get()) - { - _suspensionlogger.info("Subscription(" + debugIdentity() + ") has sendLock set so closing."); - } - } +// if (_suspensionlogger.isInfoEnabled()) +// { +// if (channel.isSuspended()) +// { +// _suspensionlogger.debug("Subscription(" + debugIdentity() + ") channel's is susupended"); +// } +// if (_sendLock.get()) +// { +// _suspensionlogger.debug("Subscription(" + debugIdentity() + ") has sendLock set so closing."); +// } +// } return channel.isSuspended() || _sendLock.get(); } @@ -381,11 +381,11 @@ public class SubscriptionImpl implements Subscription { if (localInstance == msgInstance || localInstance.equals(msgInstance)) { - if (_logger.isTraceEnabled()) - { - _logger.trace("(" + debugIdentity() + ") has no interest as it is a local message(" + - msg.debugIdentity() + ")"); - } +// if (_logger.isTraceEnabled()) +// { +// _logger.trace("(" + debugIdentity() + ") has no interest as it is a local message(" + +// msg.debugIdentity() + ")"); +// } return false; } } @@ -399,11 +399,11 @@ public class SubscriptionImpl implements Subscription msgInstance = publisher.getClientIdentifier(); if (localInstance == msgInstance || ((localInstance != null) && localInstance.equals(msgInstance))) { - if (_logger.isTraceEnabled()) - { - _logger.trace("(" + debugIdentity() + ") has no interest as it is a local message(" + - msg.debugIdentity() + ")"); - } +// if (_logger.isTraceEnabled()) +// { +// _logger.trace("(" + debugIdentity() + ") has no interest as it is a local message(" + +// msg.debugIdentity() + ")"); +// } return false; } } @@ -431,18 +431,18 @@ public class SubscriptionImpl implements Subscription { if (_filters != null) { - if (_logger.isTraceEnabled()) - { - _logger.trace("(" + debugIdentity() + ") has filters."); - } +// if (_logger.isTraceEnabled()) +// { +// _logger.trace("(" + debugIdentity() + ") has filters."); +// } return _filters.allAllow(msg); } else { - if (_logger.isTraceEnabled()) - { - _logger.trace("(" + debugIdentity() + ") has no filters"); - } +// if (_logger.isTraceEnabled()) +// { +// _logger.trace("(" + debugIdentity() + ") has no filters"); +// } return true; } diff --git a/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java b/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java index d12f5cd084..50129ec274 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java +++ b/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java @@ -241,10 +241,6 @@ public class AMQStateManager implements AMQMethodListener B frame) throws IllegalStateTransitionException { - if (_logger.isDebugEnabled()) - { - _logger.debug("Looking for state transition handler for frame " + frame.getClass()); - } final Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>> classToHandlerMap = _state2HandlersMap.get(currentState); diff --git a/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java b/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java index f2492585bc..3f6ef73781 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java +++ b/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java @@ -15,12 +15,14 @@ public final class AMQShortString implements CharSequence, Comparable<AMQShortSt private final ByteBuffer _data;
private int _hashCode;
+ final int _length;
private static final char[] EMPTY_CHAR_ARRAY = new char[0];
public AMQShortString(byte[] data)
{
_data = ByteBuffer.wrap(data);
+ _length = data.length;
}
@@ -45,6 +47,7 @@ public final class AMQShortString implements CharSequence, Comparable<AMQShortSt _data = ByteBuffer.wrap(stringBytes);
_data.rewind();
+ _length = length;
}
@@ -62,12 +65,14 @@ public final class AMQShortString implements CharSequence, Comparable<AMQShortSt _data = ByteBuffer.wrap(stringBytes);
_data.rewind();
_hashCode = hash;
+ _length = length;
}
private AMQShortString(ByteBuffer data)
{
_data = data;
+ _length = data.limit();
}
@@ -78,7 +83,7 @@ public final class AMQShortString implements CharSequence, Comparable<AMQShortSt */
public int length()
{
- return _data.limit();
+ return _length;
}
public char charAt(int index)
diff --git a/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java b/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java index 008afb490e..dd872c31b0 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java +++ b/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java @@ -83,6 +83,20 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti private AMQShortString _clusterId; private int _propertyFlags = 0; + private static final int CONTENT_TYPE_MASK = 1 << 15; + private static final int ENCONDING_MASK = 1 << 14; + private static final int HEADERS_MASK = 1 << 13; + private static final int DELIVERY_MODE_MASK = 1 << 12; + private static final int PROPRITY_MASK = 1 << 11; + private static final int CORRELATION_ID_MASK = 1 << 10; + private static final int REPLY_TO_MASK = 1 << 9; + private static final int EXPIRATION_MASK = 1 << 8; + private static final int MESSAGE_ID_MASK = 1 << 7; + private static final int TIMESTAMP_MASK = 1 << 6; + private static final int TYPE_MASK = 1 << 5; + private static final int USER_ID_MASK = 1 << 4; + private static final int APPLICATION_ID_MASK = 1 << 3; + private static final int CLUSTER_ID_MASK = 1 << 2; public BasicContentHeaderProperties() { @@ -98,35 +112,35 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti { int size = 0; - if ((_propertyFlags & (1 << 15)) > 0) + if ((_propertyFlags & (CONTENT_TYPE_MASK)) > 0) { size += EncodingUtils.encodedShortStringLength(_contentType); } - if ((_propertyFlags & (1 << 14)) > 0) + if ((_propertyFlags & ENCONDING_MASK) > 0) { size += EncodingUtils.encodedShortStringLength(_encoding); } - if ((_propertyFlags & (1 << 13)) > 0) + if ((_propertyFlags & HEADERS_MASK) > 0) { size += EncodingUtils.encodedFieldTableLength(_headers); } - if ((_propertyFlags & (1 << 12)) > 0) + if ((_propertyFlags & DELIVERY_MODE_MASK) > 0) { size += 1; } - if ((_propertyFlags & (1 << 11)) > 0) + if ((_propertyFlags & PROPRITY_MASK) > 0) { size += 1; } - if ((_propertyFlags & (1 << 10)) > 0) + if ((_propertyFlags & CORRELATION_ID_MASK) > 0) { size += EncodingUtils.encodedShortStringLength(_correlationId); } - if ((_propertyFlags & (1 << 9)) > 0) + if ((_propertyFlags & REPLY_TO_MASK) > 0) { size += EncodingUtils.encodedShortStringLength(_replyTo); } - if ((_propertyFlags & (1 << 8)) > 0) + if ((_propertyFlags & EXPIRATION_MASK) > 0) { if(_expiration == 0L) { @@ -137,27 +151,27 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti size += EncodingUtils.encodedShortStringLength(_expiration); } } - if ((_propertyFlags & (1 << 7)) > 0) + if ((_propertyFlags & MESSAGE_ID_MASK) > 0) { size += EncodingUtils.encodedShortStringLength(_messageId); } - if ((_propertyFlags & (1 << 6)) > 0) + if ((_propertyFlags & TIMESTAMP_MASK) > 0) { size += 8; } - if ((_propertyFlags & (1 << 5)) > 0) + if ((_propertyFlags & TYPE_MASK) > 0) { size += EncodingUtils.encodedShortStringLength(_type); } - if ((_propertyFlags & (1 << 4)) > 0) + if ((_propertyFlags & USER_ID_MASK) > 0) { size += EncodingUtils.encodedShortStringLength(_userId); } - if ((_propertyFlags & (1 << 3)) > 0) + if ((_propertyFlags & APPLICATION_ID_MASK) > 0) { size += EncodingUtils.encodedShortStringLength(_appId); } - if ((_propertyFlags & (1 << 2)) > 0) + if ((_propertyFlags & CLUSTER_ID_MASK) > 0) { size += EncodingUtils.encodedShortStringLength(_clusterId); } @@ -193,35 +207,35 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti } else { - if ((_propertyFlags & (1 << 15)) > 0) + if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0) { EncodingUtils.writeShortStringBytes(buffer, _contentType); } - if ((_propertyFlags & (1 << 14)) > 0) + if ((_propertyFlags & ENCONDING_MASK) != 0) { EncodingUtils.writeShortStringBytes(buffer, _encoding); } - if ((_propertyFlags & (1 << 13)) > 0) + if ((_propertyFlags & HEADERS_MASK) != 0) { EncodingUtils.writeFieldTableBytes(buffer, _headers); } - if ((_propertyFlags & (1 << 12)) > 0) + if ((_propertyFlags & DELIVERY_MODE_MASK) != 0) { buffer.put(_deliveryMode); } - if ((_propertyFlags & (1 << 11)) > 0) + if ((_propertyFlags & PROPRITY_MASK) != 0) { buffer.put(_priority); } - if ((_propertyFlags & (1 << 10)) > 0) + if ((_propertyFlags & CORRELATION_ID_MASK) != 0) { EncodingUtils.writeShortStringBytes(buffer, _correlationId); } - if ((_propertyFlags & (1 << 9)) > 0) + if ((_propertyFlags & REPLY_TO_MASK) != 0) { EncodingUtils.writeShortStringBytes(buffer, _replyTo); } - if ((_propertyFlags & (1 << 8)) > 0) + if ((_propertyFlags & EXPIRATION_MASK) != 0) { if(_expiration == 0L) { @@ -232,27 +246,27 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti EncodingUtils.writeShortStringBytes(buffer, String.valueOf(_expiration)); } } - if ((_propertyFlags & (1 << 7)) > 0) + if ((_propertyFlags & MESSAGE_ID_MASK) != 0) { EncodingUtils.writeShortStringBytes(buffer, _messageId); } - if ((_propertyFlags & (1 << 6)) > 0) + if ((_propertyFlags & TIMESTAMP_MASK) != 0) { EncodingUtils.writeTimestamp(buffer, _timestamp); } - if ((_propertyFlags & (1 << 5)) > 0) + if ((_propertyFlags & TYPE_MASK) != 0) { EncodingUtils.writeShortStringBytes(buffer, _type); } - if ((_propertyFlags & (1 << 4)) > 0) + if ((_propertyFlags & USER_ID_MASK) != 0) { EncodingUtils.writeShortStringBytes(buffer, _userId); } - if ((_propertyFlags & (1 << 3)) > 0) + if ((_propertyFlags & APPLICATION_ID_MASK) != 0) { EncodingUtils.writeShortStringBytes(buffer, _appId); } - if ((_propertyFlags & (1 << 2)) > 0) + if ((_propertyFlags & CLUSTER_ID_MASK) != 0) { EncodingUtils.writeShortStringBytes(buffer, _clusterId); } @@ -282,59 +296,59 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti int pos = buffer.position(); try { - if ((_propertyFlags & (1 << 15)) > 0) + if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0) { _contentType = EncodingUtils.readAMQShortString(buffer); } - if ((_propertyFlags & (1 << 14)) > 0) + if ((_propertyFlags & ENCONDING_MASK) != 0) { _encoding = EncodingUtils.readAMQShortString(buffer); } - if ((_propertyFlags & (1 << 13)) > 0) + if ((_propertyFlags & HEADERS_MASK) != 0) { _headers = EncodingUtils.readFieldTable(buffer); } - if ((_propertyFlags & (1 << 12)) > 0) + if ((_propertyFlags & DELIVERY_MODE_MASK) != 0) { _deliveryMode = buffer.get(); } - if ((_propertyFlags & (1 << 11)) > 0) + if ((_propertyFlags & PROPRITY_MASK) != 0) { _priority = buffer.get(); } - if ((_propertyFlags & (1 << 10)) > 0) + if ((_propertyFlags & CORRELATION_ID_MASK) != 0) { _correlationId = EncodingUtils.readAMQShortString(buffer); } - if ((_propertyFlags & (1 << 9)) > 0) + if ((_propertyFlags & REPLY_TO_MASK) != 0) { _replyTo = EncodingUtils.readAMQShortString(buffer); } - if ((_propertyFlags & (1 << 8)) > 0) + if ((_propertyFlags & EXPIRATION_MASK) != 0) { _expiration = EncodingUtils.readLongAsShortString(buffer); } - if ((_propertyFlags & (1 << 7)) > 0) + if ((_propertyFlags & MESSAGE_ID_MASK) != 0) { _messageId = EncodingUtils.readAMQShortString(buffer); } - if ((_propertyFlags & (1 << 6)) > 0) + if ((_propertyFlags & TIMESTAMP_MASK) != 0) { _timestamp = EncodingUtils.readTimestamp(buffer); } - if ((_propertyFlags & (1 << 5)) > 0) + if ((_propertyFlags & TYPE_MASK) != 0) { _type = EncodingUtils.readAMQShortString(buffer); } - if ((_propertyFlags & (1 << 4)) > 0) + if ((_propertyFlags & USER_ID_MASK) != 0) { _userId = EncodingUtils.readAMQShortString(buffer); } - if ((_propertyFlags & (1 << 3)) > 0) + if ((_propertyFlags & APPLICATION_ID_MASK) != 0) { _appId = EncodingUtils.readAMQShortString(buffer); } - if ((_propertyFlags & (1 << 2)) > 0) + if ((_propertyFlags & CLUSTER_ID_MASK) != 0) { _clusterId = EncodingUtils.readAMQShortString(buffer); } @@ -362,17 +376,17 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti ByteBuffer buffer = ByteBuffer.wrap(_encodedForm); try { - if ((_propertyFlags & (1 << 15)) > 0) + if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0) { byte length = buffer.get(); buffer.skip(length); } - if ((_propertyFlags & (1 << 14)) > 0) + if ((_propertyFlags & ENCONDING_MASK) != 0) { byte length = buffer.get(); buffer.skip(length); } - if ((_propertyFlags & (1 << 13)) > 0) + if ((_propertyFlags & HEADERS_MASK) != 0) { _headers = EncodingUtils.readFieldTable(buffer); @@ -389,7 +403,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti { ByteBuffer buffer = ByteBuffer.wrap(_encodedForm); - if ((_propertyFlags & (1 << 15)) > 0) + if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0) { _contentType = EncodingUtils.readAMQShortString(buffer); } @@ -437,7 +451,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setContentType(AMQShortString contentType) { clearEncodedForm(); - _propertyFlags |= (1 << 15); + _propertyFlags |= (CONTENT_TYPE_MASK); _contentType = contentType; } @@ -462,14 +476,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setEncoding(String encoding) { clearEncodedForm(); - _propertyFlags |= (1 << 14); + _propertyFlags |= ENCONDING_MASK; _encoding = encoding == null ? null : new AMQShortString(encoding); } public void setEncoding(AMQShortString encoding) { clearEncodedForm(); - _propertyFlags |= (1 << 14); + _propertyFlags |= ENCONDING_MASK; _encoding = encoding; } @@ -489,7 +503,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setHeaders(FieldTable headers) { clearEncodedForm(); - _propertyFlags |= (1 << 13); + _propertyFlags |= HEADERS_MASK; _headers = headers; } @@ -503,7 +517,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setDeliveryMode(byte deliveryMode) { clearEncodedForm(); - _propertyFlags |= (1 << 12); + _propertyFlags |= DELIVERY_MODE_MASK; _deliveryMode = deliveryMode; } @@ -516,7 +530,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setPriority(byte priority) { clearEncodedForm(); - _propertyFlags |= (1 << 11); + _propertyFlags |= PROPRITY_MASK; _priority = priority; } @@ -540,7 +554,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setCorrelationId(AMQShortString correlationId) { clearEncodedForm(); - _propertyFlags |= (1 << 10); + _propertyFlags |= CORRELATION_ID_MASK; _correlationId = correlationId; } @@ -566,7 +580,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti { clearEncodedForm(); - _propertyFlags |= (1 << 9); + _propertyFlags |= REPLY_TO_MASK; _replyTo = replyTo; } @@ -579,7 +593,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setExpiration(long expiration) { clearEncodedForm(); - _propertyFlags |= (1 << 8); + _propertyFlags |= EXPIRATION_MASK; _expiration = expiration; } @@ -599,14 +613,14 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setMessageId(String messageId) { clearEncodedForm(); - _propertyFlags |= (1 << 7); + _propertyFlags |= MESSAGE_ID_MASK; _messageId = messageId == null ? null : new AMQShortString(messageId); } public void setMessageId(AMQShortString messageId) { clearEncodedForm(); - _propertyFlags |= (1 << 7); + _propertyFlags |= MESSAGE_ID_MASK; _messageId = messageId; } @@ -620,7 +634,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setTimestamp(long timestamp) { clearEncodedForm(); - _propertyFlags |= (1 << 6); + _propertyFlags |= TIMESTAMP_MASK; _timestamp = timestamp; } @@ -646,7 +660,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setType(AMQShortString type) { clearEncodedForm(); - _propertyFlags |= (1 << 5); + _propertyFlags |= TYPE_MASK; _type = type; } @@ -670,7 +684,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setUserId(AMQShortString userId) { clearEncodedForm(); - _propertyFlags |= (1 << 4); + _propertyFlags |= USER_ID_MASK; _userId = userId; } @@ -694,7 +708,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setAppId(AMQShortString appId) { clearEncodedForm(); - _propertyFlags |= (1 << 3); + _propertyFlags |= APPLICATION_ID_MASK; _appId = appId; } @@ -718,7 +732,7 @@ public class BasicContentHeaderProperties implements CommonContentHeaderProperti public void setClusterId(AMQShortString clusterId) { clearEncodedForm(); - _propertyFlags |= (1 << 2); + _propertyFlags |= CLUSTER_ID_MASK; _clusterId = clusterId; } diff --git a/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java b/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java index f0cdda487c..62fefdc2fc 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java +++ b/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java @@ -157,7 +157,7 @@ public class EncodingUtils } else { - return (short) (1 + s.length()); + return (1 + s.length()); } } @@ -1023,4 +1023,7 @@ public class EncodingUtils return l; } + + + } |
