You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2007/01/08 18:02:37 UTC
svn commit: r494121 [1/5] - in /incubator/qpid/trunk/qpid:
gentools/src/org/apache/qpid/gentools/
java/broker/src/main/java/org/apache/qpid/server/
java/broker/src/main/java/org/apache/qpid/server/ack/
java/broker/src/main/java/org/apache/qpid/server/c...
Author: rgreig
Date: Mon Jan 8 09:02:26 2007
New Revision: 494121
URL: http://svn.apache.org/viewvc?view=rev&rev=494121
Log:
QPID-255 : Patch Supplied by Rob Godfrey - Change to use bespoke AMQShortString rather than converting to String
Added:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java
- copied, changed from r494042, incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMXProperty.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java
Removed:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMXProperty.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/JMSPropertyFieldTable.java
incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/framing/JMSPropertyFieldTableTest.java
Modified:
incubator/qpid/trunk/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/jms/JMSMessage.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentDeliveryManager.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentSelectorDeliveryManager.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DeliveryManager.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionFactory.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SynchronizedDeliveryManager.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationManager.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/NullAuthenticationManager.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/SASLAuthenticationManager.java
incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/amqplain/AmqPlainSaslServer.java
incubator/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClient.java
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/ack/RecoverTest.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableKeyEnumeratorTest.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/TextMessageTest.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/SpecialQueue.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterCapability.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberHandle.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxy.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleMemberHandle.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChannelQueueManager.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandlerFactory.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/LocalQueueDeclareHandler.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.java
incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteQueueProxy.java
incubator/qpid/trunk/qpid/java/cluster/src/test/java/org/apache/qpid/server/cluster/ClusterCapabilityTest.java
incubator/qpid/trunk/qpid/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleClusterTest.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/common/AMQPFilterTypes.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURL.java
incubator/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AckTest.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/ConcurrencyTest.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/ConcurrentDeliveryManagerTest.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/DeliveryManagerTest.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/MockProtocolSession.java
incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/SynchronizedDeliveryManagerTest.java
Modified: incubator/qpid/trunk/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java (original)
+++ incubator/qpid/trunk/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java Mon Jan 8 09:02:26 2007
@@ -320,10 +320,10 @@
"EncodingUtils.writeUnsignedShort(buffer, #)", // encode expression
"# = buffer.getUnsignedShort()")); // decode expression
typeMap.put("shortstr", new DomainInfo(
- "String", // Java code type
+ "AMQShortString", // Java code type
"EncodingUtils.encodedShortStringLength(#)", // size
"EncodingUtils.writeShortStringBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readShortString(buffer)")); // decode expression
+ "# = EncodingUtils.readAMQShortString(buffer)")); // decode expression
typeMap.put("table", new DomainInfo(
"FieldTable", // Java code type
"EncodingUtils.encodedFieldTableLength(#)", // size
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java Mon Jan 8 09:02:26 2007
@@ -31,6 +31,7 @@
import org.apache.qpid.server.registry.IApplicationRegistry;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
import javax.management.JMException;
import javax.management.MBeanException;
@@ -81,10 +82,10 @@
{
synchronized (_exchangeRegistry)
{
- Exchange exchange = _exchangeRegistry.getExchange(exchangeName);
+ Exchange exchange = _exchangeRegistry.getExchange(new AMQShortString(exchangeName));
if (exchange == null)
{
- exchange = _exchangeFactory.createExchange(exchangeName, type, durable, autoDelete, 0);
+ exchange = _exchangeFactory.createExchange(new AMQShortString(exchangeName), new AMQShortString(type), durable, autoDelete, 0);
_exchangeRegistry.registerExchange(exchange);
}
else
@@ -114,7 +115,7 @@
// when there are no bindings.
try
{
- _exchangeRegistry.unregisterExchange(exchangeName, false);
+ _exchangeRegistry.unregisterExchange(new AMQShortString(exchangeName), false);
}
catch (AMQException ex)
{
@@ -135,7 +136,7 @@
public void createNewQueue(String queueName, boolean durable, String owner, boolean autoDelete)
throws JMException
{
- AMQQueue queue = _queueRegistry.getQueue(queueName);
+ AMQQueue queue = _queueRegistry.getQueue(new AMQShortString(queueName));
if (queue != null)
{
throw new JMException("The queue \"" + queueName + "\" already exists.");
@@ -143,7 +144,7 @@
try
{
- queue = new AMQQueue(queueName, durable, owner, autoDelete, _queueRegistry);
+ queue = new AMQQueue(new AMQShortString(queueName), durable, new AMQShortString(owner), autoDelete, _queueRegistry);
if (queue.isDurable() && !queue.isAutoDelete())
{
_messageStore.createQueue(queue);
@@ -164,7 +165,7 @@
*/
public void deleteQueue(String queueName) throws JMException
{
- AMQQueue queue = _queueRegistry.getQueue(queueName);
+ AMQQueue queue = _queueRegistry.getQueue(new AMQShortString(queueName));
if (queue == null)
{
throw new JMException("The Queue " + queueName + " is not a registerd queue.");
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java Mon Jan 8 09:02:26 2007
@@ -22,10 +22,7 @@
import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.framing.*;
import org.apache.qpid.server.ack.UnacknowledgedMessage;
import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
import org.apache.qpid.server.ack.UnacknowledgedMessageMapImpl;
@@ -88,7 +85,7 @@
/**
* Maps from consumer tag to queue instance. Allows us to unsubscribe from a queue.
*/
- private final Map<String, AMQQueue> _consumerTag2QueueMap = new TreeMap<String, AMQQueue>();
+ private final Map<AMQShortString, AMQQueue> _consumerTag2QueueMap = new HashMap<AMQShortString, AMQQueue>();
private final MessageStore _messageStore;
@@ -270,12 +267,12 @@
* @throws ConsumerTagNotUniqueException if the tag is not unique
* @throws AMQException if something goes wrong
*/
- public String subscribeToQueue(String tag, AMQQueue queue, AMQProtocolSession session, boolean acks,
+ public AMQShortString subscribeToQueue(AMQShortString tag, AMQQueue queue, AMQProtocolSession session, boolean acks,
FieldTable filters, boolean noLocal) throws AMQException, ConsumerTagNotUniqueException
{
if (tag == null)
{
- tag = "sgen_" + getNextConsumerTag();
+ tag = new AMQShortString("sgen_" + getNextConsumerTag());
}
if (_consumerTag2QueueMap.containsKey(tag))
{
@@ -288,7 +285,7 @@
}
- public void unsubscribeConsumer(AMQProtocolSession session, String consumerTag) throws AMQException
+ public void unsubscribeConsumer(AMQProtocolSession session, AMQShortString consumerTag) throws AMQException
{
AMQQueue q = _consumerTag2QueueMap.remove(consumerTag);
if (q != null)
@@ -312,7 +309,7 @@
private void unsubscribeAllConsumers(AMQProtocolSession session) throws AMQException
{
_log.info("Unsubscribing all consumers on channel " + toString());
- for (Map.Entry<String, AMQQueue> me : _consumerTag2QueueMap.entrySet())
+ for (Map.Entry<AMQShortString, AMQQueue> me : _consumerTag2QueueMap.entrySet())
{
me.getValue().unregisterProtocolSession(session, _channelId, me.getKey());
}
@@ -327,7 +324,7 @@
* the delivery tag)
* @param queue the queue from which the message was delivered
*/
- public void addUnacknowledgedMessage(AMQMessage message, long deliveryTag, String consumerTag, AMQQueue queue)
+ public void addUnacknowledgedMessage(AMQMessage message, long deliveryTag, AMQShortString consumerTag, AMQQueue queue)
{
_unacknowledgedMessageMap.add(deliveryTag, new UnacknowledgedMessage(queue, message, consumerTag, deliveryTag));
checkSuspension();
@@ -362,7 +359,7 @@
public boolean callback(UnacknowledgedMessage message) throws AMQException
{
long deliveryTag = message.deliveryTag;
- String consumerTag = message.consumerTag;
+ AMQShortString consumerTag = message.consumerTag;
AMQMessage msg = message.message;
msg.setRedelivered(true);
msg.writeDeliver(session, _channelId, deliveryTag, consumerTag);
@@ -437,7 +434,7 @@
return _unacknowledgedMessageMap;
}
- public void addUnacknowledgedBrowsedMessage(AMQMessage msg, long deliveryTag, String consumerTag, AMQQueue queue)
+ public void addUnacknowledgedBrowsedMessage(AMQMessage msg, long deliveryTag, AMQShortString consumerTag, AMQQueue queue)
{
_browsedAcks.add(deliveryTag);
addUnacknowledgedMessage(msg, deliveryTag, consumerTag, queue);
@@ -524,7 +521,7 @@
for (RequiredDeliveryException bouncedMessage : _returnMessages)
{
AMQMessage message = bouncedMessage.getAMQMessage();
- message.writeReturn(session, _channelId, bouncedMessage.getReplyCode(), bouncedMessage.getMessage());
+ message.writeReturn(session, _channelId, bouncedMessage.getReplyCode(), new AMQShortString(bouncedMessage.getMessage()));
}
_returnMessages.clear();
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.java Mon Jan 8 09:02:26 2007
@@ -21,6 +21,7 @@
package org.apache.qpid.server.ack;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.queue.AMQMessage;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.store.StoreContext;
@@ -28,11 +29,11 @@
public class UnacknowledgedMessage
{
public final AMQMessage message;
- public final String consumerTag;
+ public final AMQShortString consumerTag;
public final long deliveryTag;
public AMQQueue queue;
- public UnacknowledgedMessage(AMQQueue queue, AMQMessage message, String consumerTag, long deliveryTag)
+ public UnacknowledgedMessage(AMQQueue queue, AMQMessage message, AMQShortString consumerTag, long deliveryTag)
{
this.queue = queue;
this.message = message;
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java Mon Jan 8 09:02:26 2007
@@ -24,6 +24,7 @@
import org.apache.qpid.server.protocol.AMQProtocolSession;
import org.apache.qpid.server.txn.TransactionalContext;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
import java.util.*;
@@ -180,7 +181,7 @@
for (Map.Entry<Long, UnacknowledgedMessage> entry : _map.entrySet())
{
long deliveryTag = entry.getKey();
- String consumerTag = entry.getValue().consumerTag;
+ AMQShortString consumerTag = entry.getValue().consumerTag;
AMQMessage msg = entry.getValue().message;
msg.writeDeliver(protocolSession, channelId, deliveryTag, consumerTag);
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java Mon Jan 8 09:02:26 2007
@@ -29,6 +29,7 @@
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.log4j.Logger;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;
@@ -157,7 +158,7 @@
private void bind(AMQBindingURL binding) throws AMQException, ConfigurationException
{
- String queueName = binding.getQueueName();
+ AMQShortString queueName = binding.getQueueName();
// This will occur if the URL is a Topic
if (queueName == null)
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java Mon Jan 8 09:02:26 2007
@@ -21,6 +21,7 @@
package org.apache.qpid.server.exchange;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.management.AMQManagedObject;
import org.apache.qpid.server.management.Managable;
import org.apache.qpid.server.management.ManagedObject;
@@ -31,7 +32,7 @@
public abstract class AbstractExchange implements Exchange, Managable
{
- private String _name;
+ private AMQShortString _name;
protected boolean _durable;
protected String _exchangeType;
@@ -58,12 +59,12 @@
public String getObjectInstanceName()
{
- return _name;
+ return _name.toString();
}
public String getName()
{
- return _name;
+ return _name.toString();
}
public String getExchangeType()
@@ -95,7 +96,7 @@
} // End of MBean class
- public String getName()
+ public AMQShortString getName()
{
return _name;
}
@@ -107,7 +108,7 @@
*/
protected abstract ExchangeMBean createMBean() throws AMQException;
- public void initialise(String name, boolean durable, int ticket, boolean autoDelete) throws AMQException
+ public void initialise(AMQShortString name, boolean durable, int ticket, boolean autoDelete) throws AMQException
{
_name = name;
_durable = durable;
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java Mon Jan 8 09:02:26 2007
@@ -22,6 +22,8 @@
import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
+import org.apache.qpid.exchange.ExchangeDefaults;
+import org.apache.qpid.framing.AMQShortString;
import java.util.HashMap;
import java.util.Map;
@@ -30,16 +32,16 @@
{
private static final Logger _logger = Logger.getLogger(DefaultExchangeFactory.class);
- private Map<String, Class<? extends Exchange>> _exchangeClassMap = new HashMap<String, Class<? extends Exchange>>();
+ private Map<AMQShortString, Class<? extends Exchange>> _exchangeClassMap = new HashMap<AMQShortString, Class<? extends Exchange>>();
public DefaultExchangeFactory()
{
- _exchangeClassMap.put("direct", org.apache.qpid.server.exchange.DestNameExchange.class);
- _exchangeClassMap.put("topic", org.apache.qpid.server.exchange.DestWildExchange.class);
- _exchangeClassMap.put("headers", org.apache.qpid.server.exchange.HeadersExchange.class);
+ _exchangeClassMap.put(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, org.apache.qpid.server.exchange.DestNameExchange.class);
+ _exchangeClassMap.put(ExchangeDefaults.TOPIC_EXCHANGE_CLASS, org.apache.qpid.server.exchange.DestWildExchange.class);
+ _exchangeClassMap.put(ExchangeDefaults.HEADERS_EXCHANGE_CLASS, org.apache.qpid.server.exchange.HeadersExchange.class);
}
- public Exchange createExchange(String exchange, String type, boolean durable, boolean autoDelete,
+ public Exchange createExchange(AMQShortString exchange, AMQShortString type, boolean durable, boolean autoDelete,
int ticket)
throws AMQException
{
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java Mon Jan 8 09:02:26 2007
@@ -22,6 +22,7 @@
import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.protocol.ExchangeInitialiser;
import org.apache.qpid.server.queue.AMQMessage;
@@ -35,7 +36,7 @@
/**
* Maps from exchange name to exchange instance
*/
- private ConcurrentMap<String, Exchange> _exchangeMap = new ConcurrentHashMap<String, Exchange>();
+ private ConcurrentMap<AMQShortString, Exchange> _exchangeMap = new ConcurrentHashMap<AMQShortString, Exchange>();
public DefaultExchangeRegistry(ExchangeFactory exchangeFactory)
{
@@ -55,7 +56,7 @@
_exchangeMap.put(exchange.getName(), exchange);
}
- public void unregisterExchange(String name, boolean inUse) throws AMQException
+ public void unregisterExchange(AMQShortString name, boolean inUse) throws AMQException
{
// TODO: check inUse argument
Exchange e = _exchangeMap.remove(name);
@@ -69,7 +70,7 @@
}
}
- public Exchange getExchange(String name)
+ public Exchange getExchange(AMQShortString name)
{
return _exchangeMap.get(name);
}
@@ -81,7 +82,7 @@
*/
public void routeContent(AMQMessage payload) throws AMQException
{
- final String exchange = payload.getPublishBody().exchange;
+ final AMQShortString exchange = payload.getPublishBody().exchange;
final Exchange exch = _exchangeMap.get(exchange);
// there is a small window of opportunity for the exchange to be deleted in between
// the BasicPublish being received (where the exchange is validated) and the final
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.java Mon Jan 8 09:02:26 2007
@@ -24,6 +24,7 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.BasicPublishBody;
import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.management.MBeanConstructor;
import org.apache.qpid.server.management.MBeanDescription;
import org.apache.qpid.server.queue.AMQMessage;
@@ -83,21 +84,21 @@
public TabularData bindings() throws OpenDataException
{
- Map<String, List<AMQQueue>> bindings = _index.getBindingsMap();
+ Map<AMQShortString, List<AMQQueue>> bindings = _index.getBindingsMap();
_bindingList = new TabularDataSupport(_bindinglistDataType);
- for (Map.Entry<String, List<AMQQueue>> entry : bindings.entrySet())
+ for (Map.Entry<AMQShortString, List<AMQQueue>> entry : bindings.entrySet())
{
- String key = entry.getKey();
+ AMQShortString key = entry.getKey();
List<String> queueList = new ArrayList<String>();
List<AMQQueue> queues = entry.getValue();
for (AMQQueue q : queues)
{
- queueList.add(q.getName());
+ queueList.add(q.getName().toString());
}
- Object[] bindingItemValues = {key, queueList.toArray(new String[0])};
+ Object[] bindingItemValues = {key.toString(), queueList.toArray(new String[0])};
CompositeData bindingData = new CompositeDataSupport(_bindingDataType, _bindingItemNames, bindingItemValues);
_bindingList.put(bindingData);
}
@@ -107,7 +108,7 @@
public void createNewBinding(String queueName, String binding) throws JMException
{
- AMQQueue queue = ApplicationRegistry.getInstance().getQueueRegistry().getQueue(queueName);
+ AMQQueue queue = ApplicationRegistry.getInstance().getQueueRegistry().getQueue(new AMQShortString(queueName));
if (queue == null)
{
throw new JMException("Queue \"" + queueName + "\" is not registered with the exchange.");
@@ -115,8 +116,8 @@
try
{
- registerQueue(binding, queue, null);
- queue.bind(binding, DestNameExchange.this);
+ registerQueue(new AMQShortString(binding), queue, null);
+ queue.bind(new AMQShortString(binding), DestNameExchange.this);
}
catch (AMQException ex)
{
@@ -140,7 +141,7 @@
}
}
- public void registerQueue(String routingKey, AMQQueue queue, FieldTable args) throws AMQException
+ public void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
{
assert queue != null;
assert routingKey != null;
@@ -154,7 +155,7 @@
}
}
- public void deregisterQueue(String routingKey, AMQQueue queue) throws AMQException
+ public void deregisterQueue(AMQShortString routingKey, AMQQueue queue) throws AMQException
{
assert queue != null;
assert routingKey != null;
@@ -169,7 +170,7 @@
public void route(AMQMessage payload) throws AMQException
{
final BasicPublishBody publishBody = payload.getPublishBody();
- final String routingKey = publishBody.routingKey;
+ final AMQShortString routingKey = publishBody.routingKey;
final List<AMQQueue> queues = (routingKey == null) ? null : _index.get(routingKey);
if (queues == null || queues.isEmpty())
{
@@ -197,13 +198,13 @@
}
}
- public boolean isBound(String routingKey, AMQQueue queue) throws AMQException
+ public boolean isBound(AMQShortString routingKey, AMQQueue queue) throws AMQException
{
final List<AMQQueue> queues = _index.get(routingKey);
return queues != null && queues.contains(queue);
}
- public boolean isBound(String routingKey) throws AMQException
+ public boolean isBound(AMQShortString routingKey) throws AMQException
{
final List<AMQQueue> queues = _index.get(routingKey);
return queues != null && !queues.isEmpty();
@@ -211,7 +212,7 @@
public boolean isBound(AMQQueue queue) throws AMQException
{
- Map<String, List<AMQQueue>> bindings = _index.getBindingsMap();
+ Map<AMQShortString, List<AMQQueue>> bindings = _index.getBindingsMap();
for (List<AMQQueue> queues : bindings.values())
{
if (queues.contains(queue))
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java Mon Jan 8 09:02:26 2007
@@ -24,6 +24,7 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.BasicPublishBody;
import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.management.MBeanConstructor;
import org.apache.qpid.server.management.MBeanDescription;
import org.apache.qpid.server.queue.AMQMessage;
@@ -43,7 +44,7 @@
{
private static final Logger _logger = Logger.getLogger(DestWildExchange.class);
- private ConcurrentHashMap<String, List<AMQQueue>> _routingKey2queues = new ConcurrentHashMap<String, List<AMQQueue>>();
+ private ConcurrentHashMap<AMQShortString, List<AMQQueue>> _routingKey2queues = new ConcurrentHashMap<AMQShortString, List<AMQQueue>>();
/**
* DestWildExchangeMBean class implements the management interface for the
@@ -87,18 +88,18 @@
public TabularData bindings() throws OpenDataException
{
_bindingList = new TabularDataSupport(_bindinglistDataType);
- for (Map.Entry<String, List<AMQQueue>> entry : _routingKey2queues.entrySet())
+ for (Map.Entry<AMQShortString, List<AMQQueue>> entry : _routingKey2queues.entrySet())
{
- String key = entry.getKey();
+ AMQShortString key = entry.getKey();
List<String> queueList = new ArrayList<String>();
List<AMQQueue> queues = entry.getValue();
for (AMQQueue q : queues)
{
- queueList.add(q.getName());
+ queueList.add(q.getName().toString());
}
- Object[] bindingItemValues = {key, queueList.toArray(new String[0])};
+ Object[] bindingItemValues = {key.toString(), queueList.toArray(new String[0])};
CompositeData bindingData = new CompositeDataSupport(_bindingDataType, _bindingItemNames, bindingItemValues);
_bindingList.put(bindingData);
}
@@ -108,14 +109,14 @@
public void createNewBinding(String queueName, String binding) throws JMException
{
- AMQQueue queue = ApplicationRegistry.getInstance().getQueueRegistry().getQueue(queueName);
+ AMQQueue queue = ApplicationRegistry.getInstance().getQueueRegistry().getQueue(new AMQShortString(queueName));
if (queue == null)
throw new JMException("Queue \"" + queueName + "\" is not registered with the exchange.");
try
{
- registerQueue(binding, queue, null);
- queue.bind(binding, DestWildExchange.this);
+ registerQueue(new AMQShortString(binding), queue, null);
+ queue.bind(new AMQShortString(binding), DestWildExchange.this);
}
catch (AMQException ex)
{
@@ -126,7 +127,7 @@
} // End of MBean class
- public synchronized void registerQueue(String routingKey, AMQQueue queue, FieldTable args) throws AMQException
+ public synchronized void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
{
assert queue != null;
assert routingKey != null;
@@ -154,7 +155,7 @@
{
BasicPublishBody publishBody = payload.getPublishBody();
- final String routingKey = publishBody.routingKey;
+ final AMQShortString routingKey = publishBody.routingKey;
List<AMQQueue> queues = _routingKey2queues.get(routingKey);
// if we have no registered queues we have nothing to do
// TODO: add support for the immediate flag
@@ -175,14 +176,14 @@
}
}
- public boolean isBound(String routingKey, AMQQueue queue) throws AMQException
+ public boolean isBound(AMQShortString routingKey, AMQQueue queue) throws AMQException
{
List<AMQQueue> queues = _routingKey2queues.get(routingKey);
return queues != null && queues.contains(queue);
}
- public boolean isBound(String routingKey) throws AMQException
+ public boolean isBound(AMQShortString routingKey) throws AMQException
{
List<AMQQueue> queues = _routingKey2queues.get(routingKey);
return queues != null && !queues.isEmpty();
@@ -205,7 +206,7 @@
return !_routingKey2queues.isEmpty();
}
- public synchronized void deregisterQueue(String routingKey, AMQQueue queue) throws AMQException
+ public synchronized void deregisterQueue(AMQShortString routingKey, AMQQueue queue) throws AMQException
{
assert queue != null;
assert routingKey != null;
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java Mon Jan 8 09:02:26 2007
@@ -22,14 +22,15 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.queue.AMQMessage;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.queue.AMQMessage;
public interface Exchange
{
- String getName();
+ AMQShortString getName();
- void initialise(String name, boolean durable, int ticket, boolean autoDelete) throws AMQException;
+ void initialise(AMQShortString name, boolean durable, int ticket, boolean autoDelete) throws AMQException;
boolean isDurable();
@@ -42,9 +43,9 @@
void close() throws AMQException;
- void registerQueue(String routingKey, AMQQueue queue, FieldTable args) throws AMQException;
+ void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException;
- void deregisterQueue(String routingKey, AMQQueue queue) throws AMQException;
+ void deregisterQueue(AMQShortString routingKey, AMQQueue queue) throws AMQException;
void route(AMQMessage message) throws AMQException;
@@ -55,7 +56,7 @@
* @return
* @throws AMQException
*/
- boolean isBound(String routingKey, AMQQueue queue) throws AMQException;
+ boolean isBound(AMQShortString routingKey, AMQQueue queue) throws AMQException;
/**
* Determines whether a message is routing to any queue using a specific routing key
@@ -63,7 +64,7 @@
* @return
* @throws AMQException
*/
- boolean isBound(String routingKey) throws AMQException;
+ boolean isBound(AMQShortString routingKey) throws AMQException;
boolean isBound(AMQQueue queue) throws AMQException;
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java Mon Jan 8 09:02:26 2007
@@ -21,11 +21,12 @@
package org.apache.qpid.server.exchange;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
public interface ExchangeFactory
{
- Exchange createExchange(String exchange, String type, boolean durable, boolean autoDelete,
+ Exchange createExchange(AMQShortString exchange, AMQShortString type, boolean durable, boolean autoDelete,
int ticket)
throws AMQException;
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java Mon Jan 8 09:02:26 2007
@@ -21,6 +21,7 @@
package org.apache.qpid.server.exchange;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
public interface ExchangeRegistry extends MessageRouter
@@ -34,7 +35,7 @@
* @throws ExchangeInUseException when the exchange cannot be deleted because it is in use
* @throws AMQException
*/
- void unregisterExchange(String name, boolean inUse) throws ExchangeInUseException, AMQException;
+ void unregisterExchange(AMQShortString name, boolean inUse) throws ExchangeInUseException, AMQException;
- Exchange getExchange(String name);
+ Exchange getExchange(AMQShortString name);
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java Mon Jan 8 09:02:26 2007
@@ -34,7 +34,7 @@
{
private static final Logger _logger = Logger.getLogger(HeadersBinding.class);
- private final FieldTable _mappings = new FieldTable();
+ private final FieldTable _mappings;
private final Set<String> required = new HashSet<String>();
private final Map<String,Object> matches = new HashMap<String,Object>();
private boolean matchAny;
@@ -91,12 +91,7 @@
HeadersBinding(FieldTable mappings)
{
- Enumeration propertyNames = mappings.getPropertyNames();
- while(propertyNames.hasMoreElements())
- {
- String propName = (String) propertyNames.nextElement();
- _mappings.put(propName, mappings.getObject(propName));
- }
+ _mappings = mappings;
initMappings();
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java Mon Jan 8 09:02:26 2007
@@ -110,7 +110,7 @@
for (Iterator<Registration> itr = _bindings.iterator(); itr.hasNext();)
{
Registration registration = itr.next();
- String queueName = registration.queue.getName();
+ String queueName = registration.queue.getName().toString();
HeadersBinding headers = registration.binding;
FieldTable headerMappings = headers.getMappings();
@@ -149,7 +149,7 @@
*/
public void createNewBinding(String queueName, String binding) throws JMException
{
- AMQQueue queue = ApplicationRegistry.getInstance().getQueueRegistry().getQueue(queueName);
+ AMQQueue queue = ApplicationRegistry.getInstance().getQueueRegistry().getQueue(new AMQShortString(queueName));
if (queue == null)
{
@@ -173,13 +173,13 @@
} // End of MBean class
- public void registerQueue(String routingKey, AMQQueue queue, FieldTable args) throws AMQException
+ public void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
{
_logger.debug("Exchange " + getName() + ": Binding " + queue.getName() + " with " + args);
_bindings.add(new Registration(new HeadersBinding(args), queue));
}
- public void deregisterQueue(String routingKey, AMQQueue queue) throws AMQException
+ public void deregisterQueue(AMQShortString routingKey, AMQQueue queue) throws AMQException
{
_logger.debug("Exchange " + getName() + ": Unbinding " + queue.getName());
_bindings.remove(new Registration(null, queue));
@@ -223,12 +223,12 @@
}
}
- public boolean isBound(String routingKey, AMQQueue queue) throws AMQException
+ public boolean isBound(AMQShortString routingKey, AMQQueue queue) throws AMQException
{
return isBound(queue);
}
- public boolean isBound(String routingKey) throws AMQException
+ public boolean isBound(AMQShortString routingKey) throws AMQException
{
return hasBindings();
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java Mon Jan 8 09:02:26 2007
@@ -21,6 +21,7 @@
package org.apache.qpid.server.exchange;
import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.framing.AMQShortString;
import java.util.List;
import java.util.Map;
@@ -35,10 +36,10 @@
*/
class Index
{
- private ConcurrentMap<String, List<AMQQueue>> _index
- = new ConcurrentHashMap<String, List<AMQQueue>>();
+ private ConcurrentMap<AMQShortString, List<AMQQueue>> _index
+ = new ConcurrentHashMap<AMQShortString, List<AMQQueue>>();
- synchronized boolean add(String key, AMQQueue queue)
+ synchronized boolean add(AMQShortString key, AMQQueue queue)
{
List<AMQQueue> queues = _index.get(key);
if(queues == null)
@@ -62,7 +63,7 @@
}
}
- synchronized boolean remove(String key, AMQQueue queue)
+ synchronized boolean remove(AMQShortString key, AMQQueue queue)
{
List<AMQQueue> queues = _index.get(key);
if (queues != null)
@@ -77,13 +78,13 @@
return false;
}
- List<AMQQueue> get(String key)
+ List<AMQQueue> get(AMQShortString key)
{
return _index.get(key);
}
- Map<String, List<AMQQueue>> getBindingsMap()
+ Map<AMQShortString, List<AMQQueue>> getBindingsMap()
{
- return new HashMap<String, List<AMQQueue>>(_index);
+ return new HashMap<AMQShortString, List<AMQQueue>>(_index);
}
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java Mon Jan 8 09:02:26 2007
@@ -45,29 +45,24 @@
manager = new SimpleFilterManager();
- Iterator it = filters.keySet().iterator();
- _logger.info("Processing filters:");
- while (it.hasNext())
+ if(filters.containsKey(AMQPFilterTypes.JMS_SELECTOR.getValue()))
{
- String key = (String) it.next();
- _logger.info("filter:" + key);
- if (key.equals(AMQPFilterTypes.JMS_SELECTOR.getValue()))
- {
- String selector = (String) filters.get(key);
-
- if (selector != null && !selector.equals(""))
- {
- manager.add(new JMSSelectorFilter(selector));
- }
- }
+ String selector = filters.getString(AMQPFilterTypes.JMS_SELECTOR.getValue());
- if (key.equals(AMQPFilterTypes.NO_CONSUME.getValue()))
+ if (selector != null && !selector.equals(""))
{
- manager.add(new NoConsumerFilter());
+ manager.add(new JMSSelectorFilter(selector));
}
}
+ if (filters.containsKey(AMQPFilterTypes.NO_CONSUME.getValue()))
+ {
+ manager.add(new NoConsumerFilter());
+ }
+
+
+
//If we added no filters don't bear the overhead of having an filter manager
if (!manager.hasFilters())
{
@@ -76,7 +71,7 @@
}
else
{
- _logger.info("No Filters found.");
+ _logger.debug("No Filters found.");
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java Mon Jan 8 09:02:26 2007
@@ -248,7 +248,7 @@
_logger.info("Looking up property:" + name);
_logger.info("Properties are:" + _properties.getHeaders().keySet());
- return _properties.getHeaders().get(name);
+ return _properties.getHeaders().getObject(name);
}
// catch (IOException ioe)
// {
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java Mon Jan 8 09:02:26 2007
@@ -23,10 +23,7 @@
import org.apache.qpid.AMQException;
import org.apache.qpid.AMQInvalidSelectorException;
import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.BasicConsumeOkBody;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.ChannelCloseBody;
+import org.apache.qpid.framing.*;
import org.apache.qpid.server.AMQChannel;
import org.apache.qpid.server.ConsumerTagNotUniqueException;
import org.apache.qpid.server.exchange.ExchangeRegistry;
@@ -77,7 +74,7 @@
}
try
{
- String consumerTag = channel.subscribeToQueue(body.consumerTag, queue, session, !body.noAck,
+ AMQShortString consumerTag = channel.subscribeToQueue(body.consumerTag, queue, session, !body.noAck,
body.arguments, body.noLocal);
if (!body.nowait)
{
@@ -103,11 +100,11 @@
BasicConsumeBody.getClazz((byte)8, (byte)0), // classId
BasicConsumeBody.getMethod((byte)8, (byte)0), // methodId
AMQConstant.INVALID_SELECTOR.getCode(), // replyCode
- ise.getMessage())); // replyText
+ new AMQShortString(ise.getMessage()))); // replyText
}
catch (ConsumerTagNotUniqueException e)
{
- String msg = "Non-unique consumer tag, '" + body.consumerTag + "'";
+ AMQShortString msg = new AMQShortString("Non-unique consumer tag, '" + body.consumerTag + "'");
// AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
// TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
// Be aware of possible changes to parameter order as versions change.
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java Mon Jan 8 09:02:26 2007
@@ -21,9 +21,11 @@
package org.apache.qpid.server.handler;
import org.apache.qpid.AMQException;
+import org.apache.qpid.exchange.ExchangeDefaults;
import org.apache.qpid.framing.AMQFrame;
import org.apache.qpid.framing.BasicPublishBody;
import org.apache.qpid.framing.ChannelCloseBody;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.AMQChannel;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.exchange.ExchangeRegistry;
@@ -36,6 +38,8 @@
public class BasicPublishMethodHandler implements StateAwareMethodListener<BasicPublishBody>
{
private static final BasicPublishMethodHandler _instance = new BasicPublishMethodHandler();
+
+ private static final AMQShortString UNKNOWN_EXCHANGE_NAME = new AMQShortString("Unknown exchange name");
public static BasicPublishMethodHandler getInstance()
{
@@ -55,7 +59,8 @@
// TODO: check the delivery tag field details - is it unique across the broker or per subscriber?
if (body.exchange == null)
{
- body.exchange = "amq.direct";
+ body.exchange = ExchangeDefaults.DIRECT_EXCHANGE_NAME;
+
}
Exchange e = exchangeRegistry.getExchange(body.exchange);
// if the exchange does not exist we raise a channel exception
@@ -72,7 +77,7 @@
ChannelCloseBody.getClazz((byte)8, (byte)0), // classId
ChannelCloseBody.getMethod((byte)8, (byte)0), // methodId
500, // replyCode
- "Unknown exchange name"); // replyText
+ UNKNOWN_EXCHANGE_NAME); // replyText
protocolSession.writeFrame(cf);
}
else
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java Mon Jan 8 09:02:26 2007
@@ -24,6 +24,7 @@
import org.apache.qpid.framing.AMQFrame;
import org.apache.qpid.framing.ConnectionOpenBody;
import org.apache.qpid.framing.ConnectionOpenOkBody;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.protocol.AMQMethodEvent;
import org.apache.qpid.server.protocol.AMQProtocolSession;
@@ -45,9 +46,9 @@
{
}
- private static String generateClientID()
+ private static AMQShortString generateClientID()
{
- return Long.toString(System.currentTimeMillis());
+ return new AMQShortString(Long.toString(System.currentTimeMillis()));
}
public void methodReceived(AMQStateManager stateManager, QueueRegistry queueRegistry,
@@ -55,7 +56,7 @@
AMQMethodEvent<ConnectionOpenBody> evt) throws AMQException
{
ConnectionOpenBody body = evt.getMethod();
- String contextKey = body.virtualHost;
+ AMQShortString contextKey = body.virtualHost;
//todo //FIXME The virtual host must be validated by the server for the connection to open-ok
// See Spec (0.8.2). Section 3.1.2 Virtual Hosts
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java Mon Jan 8 09:02:26 2007
@@ -73,7 +73,7 @@
SaslServer ss = null;
try
{
- ss = authMgr.createSaslServer(body.mechanism, protocolSession.getLocalFQDN());
+ ss = authMgr.createSaslServer(String.valueOf(body.mechanism), protocolSession.getLocalFQDN());
protocolSession.setSaslServer(ss);
AuthenticationResult authResult = authMgr.authenticate(ss, body.response);
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java Mon Jan 8 09:02:26 2007
@@ -21,6 +21,7 @@
import org.apache.qpid.framing.AMQFrame;
import org.apache.qpid.framing.ExchangeBoundBody;
import org.apache.qpid.framing.ExchangeBoundOkBody;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.protocol.AMQMethodEvent;
@@ -71,9 +72,9 @@
ExchangeBoundBody body = evt.getMethod();
- String exchangeName = body.exchange;
- String queueName = body.queue;
- String routingKey = body.routingKey;
+ AMQShortString exchangeName = body.exchange;
+ AMQShortString queueName = body.queue;
+ AMQShortString routingKey = body.routingKey;
if (exchangeName == null)
{
throw new AMQException("Exchange exchange must not be null");
@@ -86,7 +87,7 @@
response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
major, minor, // AMQP version (major, minor)
EXCHANGE_NOT_FOUND, // replyCode
- "Exchange " + exchangeName + " not found"); // replyText
+ new AMQShortString("Exchange " + exchangeName + " not found")); // replyText
}
else if (routingKey == null)
{
@@ -118,7 +119,7 @@
response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
major, minor, // AMQP version (major, minor)
QUEUE_NOT_FOUND, // replyCode
- "Queue " + queueName + " not found"); // replyText
+ new AMQShortString("Queue " + queueName + " not found")); // replyText
}
else
{
@@ -136,7 +137,7 @@
response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
major, minor, // AMQP version (major, minor)
QUEUE_NOT_BOUND, // replyCode
- "Queue " + queueName + " not bound to exchange " + exchangeName); // replyText
+ new AMQShortString("Queue " + queueName + " not bound to exchange " + exchangeName)); // replyText
}
}
}
@@ -150,7 +151,7 @@
response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
major, minor, // AMQP version (major, minor)
QUEUE_NOT_FOUND, // replyCode
- "Queue " + queueName + " not found"); // replyText
+ new AMQShortString("Queue " + queueName + " not found")); // replyText
}
else
{
@@ -168,8 +169,8 @@
response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
major, minor, // AMQP version (major, minor)
SPECIFIC_QUEUE_NOT_BOUND_WITH_RK, // replyCode
- "Queue " + queueName + " not bound with routing key " +
- body.routingKey + " to exchange " + exchangeName); // replyText
+ new AMQShortString("Queue " + queueName + " not bound with routing key " +
+ body.routingKey + " to exchange " + exchangeName)); // replyText
}
}
}
@@ -189,8 +190,8 @@
response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
major, minor, // AMQP version (major, minor)
NO_QUEUE_BOUND_WITH_RK, // replyCode
- "No queue bound with routing key " + body.routingKey +
- " to exchange " + exchangeName); // replyText
+ new AMQShortString("No queue bound with routing key " + body.routingKey +
+ " to exchange " + exchangeName)); // replyText
}
}
protocolSession.writeFrame(response);
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java Mon Jan 8 09:02:26 2007
@@ -22,10 +22,12 @@
import org.apache.log4j.Logger;
import org.apache.qpid.AMQException;
+import org.apache.qpid.exchange.ExchangeDefaults;
import org.apache.qpid.configuration.Configured;
import org.apache.qpid.framing.AMQFrame;
import org.apache.qpid.framing.QueueDeclareBody;
import org.apache.qpid.framing.QueueDeclareOkBody;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.exchange.ExchangeRegistry;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.protocol.AMQMethodEvent;
@@ -91,7 +93,7 @@
queueRegistry.registerQueue(queue);
if (autoRegister)
{
- Exchange defaultExchange = exchangeRegistry.getExchange("amq.direct");
+ Exchange defaultExchange = exchangeRegistry.getExchange(ExchangeDefaults.DIRECT_EXCHANGE_NAME);
defaultExchange.registerQueue(body.queue, queue, null);
queue.bind(body.queue, defaultExchange);
_log.info("Queue " + body.queue + " bound to default exchange");
@@ -115,9 +117,9 @@
}
}
- protected String createName()
+ protected AMQShortString createName()
{
- return "tmp_" + pad(_counter.incrementAndGet());
+ return new AMQShortString("tmp_" + pad(_counter.incrementAndGet()));
}
protected static String pad(int value)
@@ -128,7 +130,7 @@
protected AMQQueue createQueue(QueueDeclareBody body, QueueRegistry registry, AMQProtocolSession session)
throws AMQException
{
- String owner = body.exclusive ? session.getContextKey() : null;
+ AMQShortString owner = body.exclusive ? session.getContextKey() : null;
return new AMQQueue(body.queue, body.durable, owner, body.autoDelete, registry);
}
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java Mon Jan 8 09:02:26 2007
@@ -80,7 +80,7 @@
else
{
int purged = queue.delete(body.ifUnused, body.ifEmpty);
- _store.removeQueue(queue.getName());
+ _store.removeQueue(queue.getName().toString());
// AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
// TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
// Be aware of possible changes to parameter order as versions change.
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/jms/JMSMessage.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/jms/JMSMessage.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/jms/JMSMessage.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/jms/JMSMessage.java Mon Jan 8 09:02:26 2007
@@ -178,116 +178,116 @@
public void clearProperties() throws MessageNotWriteableException
{
checkWriteable();
- _properties.getJMSHeaders().clear();
+ _properties.clear();
}
public boolean propertyExists(String string)
{
- return _properties.getJMSHeaders().propertyExists(string);
+ return _properties.propertyExists(string);
}
public boolean getBooleanProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getBoolean(string);
+ return _properties.getBoolean(string);
}
public byte getByteProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getByte(string);
+ return _properties.getByte(string);
}
public short getShortProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getShort(string);
+ return _properties.getShort(string);
}
public int getIntProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getInteger(string);
+ return _properties.getInteger(string);
}
public long getLongProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getLong(string);
+ return _properties.getLong(string);
}
public float getFloatProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getFloat(string);
+ return _properties.getFloat(string);
}
public double getDoubleProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getDouble(string);
+ return _properties.getDouble(string);
}
public String getStringProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getString(string);
+ return _properties.getString(string);
}
public Object getObjectProperty(String string) throws JMSException
{
- return _properties.getJMSHeaders().getObject(string);
+ return _properties.getObject(string);
}
public Enumeration getPropertyNames()
{
- return _properties.getJMSHeaders().getPropertyNames();
+ return _properties.getPropertyNames();
}
public void setBooleanProperty(String string, boolean b) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setBoolean(string, b);
+ _properties.setBoolean(string, b);
}
public void setByteProperty(String string, byte b) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setByte(string, b);
+ _properties.setByte(string, b);
}
public void setShortProperty(String string, short i) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setShort(string, i);
+ _properties.setShort(string, i);
}
public void setIntProperty(String string, int i) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setInteger(string, i);
+ _properties.setInteger(string, i);
}
public void setLongProperty(String string, long l) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setLong(string, l);
+ _properties.setLong(string, l);
}
public void setFloatProperty(String string, float v) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setFloat(string, v);
+ _properties.setFloat(string, v);
}
public void setDoubleProperty(String string, double v) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setDouble(string, v);
+ _properties.setDouble(string, v);
}
public void setStringProperty(String string, String string1) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setString(string, string1);
+ _properties.setString(string, string1);
}
public void setObjectProperty(String string, Object object) throws JMSException
{
checkWriteable();
- _properties.getJMSHeaders().setObject(string, object);
+ _properties.setObject(string, object);
}
public void acknowledge() throws MessageNotWriteableException
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java Mon Jan 8 09:02:26 2007
@@ -26,16 +26,7 @@
import org.apache.mina.transport.vmpipe.VmPipeAddress;
import org.apache.qpid.AMQChannelException;
import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.ProtocolInitiation;
-import org.apache.qpid.framing.ConnectionStartBody;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.ProtocolVersionList;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.HeartbeatBody;
-import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.*;
import org.apache.qpid.codec.AMQCodecFactory;
import org.apache.qpid.codec.AMQDecoder;
@@ -65,7 +56,7 @@
private final IoSession _minaProtocolSession;
- private String _contextKey;
+ private AMQShortString _contextKey;
private final Map<Integer, AMQChannel> _channelMap = new HashMap<Integer, AMQChannel>();
@@ -291,12 +282,12 @@
_minaProtocolSession.write(frame);
}
- public String getContextKey()
+ public AMQShortString getContextKey()
{
return _contextKey;
}
- public void setContextKey(String contextKey)
+ public void setContextKey(AMQShortString contextKey)
{
_contextKey = contextKey;
}
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java Mon Jan 8 09:02:26 2007
@@ -180,7 +180,7 @@
0, // classId
0, // methodId
200, // replyCode
- throwable.getMessage() // replyText
+ new AMQShortString(throwable.getMessage()) // replyText
));
_logger.error("Exception caught in" + session + ", closing session explictly: " + throwable, throwable);
protocolSession.close();
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java Mon Jan 8 09:02:26 2007
@@ -22,6 +22,7 @@
import org.apache.qpid.framing.AMQDataBlock;
import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.AMQChannel;
import org.apache.qpid.AMQException;
@@ -48,14 +49,14 @@
* in the AMQ protocol specification (RFC 6).
* @return the context key
*/
- String getContextKey();
+ AMQShortString getContextKey();
/**
* Set the context key associated with this session. Context key is described
* in the AMQ protocol specification (RFC 6).
* @param contextKey the context key
*/
- void setContextKey(String contextKey);
+ void setContextKey(AMQShortString contextKey);
/**
* Get the channel for this session associated with the specified id. A channel
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java Mon Jan 8 09:02:26 2007
@@ -21,6 +21,7 @@
import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.framing.ConnectionCloseBody;
import org.apache.qpid.framing.AMQFrame;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.AMQChannel;
import org.apache.qpid.server.management.AMQManagedObject;
import org.apache.qpid.server.management.MBeanConstructor;
@@ -58,6 +59,8 @@
private OpenType[] _channelAttributeTypes = {SimpleType.INTEGER, SimpleType.BOOLEAN, SimpleType.STRING, SimpleType.INTEGER};
private CompositeType _channelType = null; // represents the data type for channel data
private TabularType _channelsType = null; // Data type for list of channels type
+ private static final AMQShortString BROKER_MANAGEMENT_CONSOLE_HAS_CLOSING_THE_CONNECTION =
+ new AMQShortString("Broker Management Console has closing the connection.");
@MBeanConstructor("Creates an MBean exposing an AMQ Broker Connection")
public AMQProtocolSessionMBean(AMQMinaProtocolSession session) throws JMException
@@ -201,7 +204,7 @@
0, // classId
0, // methodId
AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
- "Broker Management Console has closing the connection." // replyText
+ BROKER_MANAGEMENT_CONSOLE_HAS_CLOSING_THE_CONNECTION // replyText
);
_session.writeFrame(response);
Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java?view=diff&rev=494121&r1=494120&r2=494121
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java Mon Jan 8 09:02:26 2007
@@ -21,6 +21,7 @@
package org.apache.qpid.server.protocol;
import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.exchange.ExchangeDefaults;
import org.apache.qpid.server.exchange.ExchangeFactory;
import org.apache.qpid.server.exchange.ExchangeRegistry;
@@ -34,7 +35,7 @@
}
private void define(ExchangeRegistry r, ExchangeFactory f,
- String name, String type) throws AMQException
+ AMQShortString name, AMQShortString type) throws AMQException
{
r.registerExchange(f.createExchange(name, type, true, false, 0));
}