qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1081634 [7/9] - in /qpid/branches/qpid-2920/qpid: ./ bin/ cpp/ cpp/bindings/qpid/ cpp/bindings/qpid/perl/ cpp/bindings/qpid/python/ cpp/bindings/qpid/ruby/ cpp/examples/ cpp/examples/direct/ cpp/examples/failover/ cpp/examples/fanout/ cpp/...
Date Tue, 15 Mar 2011 01:54:18 GMT
Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/client.bnd
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/client.bnd?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/client.bnd (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/client.bnd Tue Mar 15 01:54:07 2011
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-ver: 0.9.0
+ver: 0.11.0
 
 Bundle-SymbolicName: qpid-client
 Bundle-Version: ${ver}

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java Tue Mar 15 01:54:07 2011
@@ -105,6 +105,21 @@ public class AMQBrokerDetails implements
             if (host == null)
             {
                 host = "";
+                
+                String auth = connection.getAuthority();
+                if (auth != null)
+                {
+                    // contains both host & port myhost:5672                
+                    if (auth.contains(":"))
+                    {
+                        host = auth.substring(0,auth.indexOf(":"));
+                    }
+                    else
+                    {
+                        host = auth;
+                    }
+                }
+
             }
 
             setHost(host);

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java Tue Mar 15 01:54:07 2011
@@ -69,6 +69,12 @@ public class AMQConnectionDelegate_0_10 
     org.apache.qpid.transport.Connection _qpidConnection;
     private ConnectionException exception = null;
 
+    static
+    {
+        // Register any configured SASL client factories.
+        org.apache.qpid.client.security.DynamicSaslRegistrar.registerSaslProviders();
+    }
+
     //--- constructor
     public AMQConnectionDelegate_0_10(AMQConnection conn)
     {

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Tue Mar 15 01:54:07 2011
@@ -1043,7 +1043,7 @@ public abstract class AMQSession<C exten
             throws JMSException
     {
         checkNotClosed();
-        AMQTopic origTopic = checkValidTopic(topic, true);
+        Topic origTopic = checkValidTopic(topic, true);
         AMQTopic dest = AMQTopic.createDurableTopic(origTopic, name, _connection);
         
         String messageSelector = ((selector == null) || (selector.trim().length() == 0)) ? null : selector;
@@ -1307,8 +1307,8 @@ public abstract class AMQSession<C exten
     public QueueReceiver createQueueReceiver(Destination destination) throws JMSException
     {
         checkValidDestination(destination);
-        AMQQueue dest = (AMQQueue) destination;
-        C consumer = (C) createConsumer(destination);
+        Queue dest = validateQueue(destination);
+        C consumer = (C) createConsumer(dest);
 
         return new QueueReceiverAdaptor(dest, consumer);
     }
@@ -1326,8 +1326,8 @@ public abstract class AMQSession<C exten
     public QueueReceiver createQueueReceiver(Destination destination, String messageSelector) throws JMSException
     {
         checkValidDestination(destination);
-        AMQQueue dest = (AMQQueue) destination;
-        C consumer = (C) createConsumer(destination, messageSelector);
+        Queue dest = validateQueue(destination);
+        C consumer = (C) createConsumer(dest, messageSelector);
 
         return new QueueReceiverAdaptor(dest, consumer);
     }
@@ -1344,7 +1344,7 @@ public abstract class AMQSession<C exten
     public QueueReceiver createReceiver(Queue queue) throws JMSException
     {
         checkNotClosed();
-        AMQQueue dest = (AMQQueue) queue;
+        Queue dest = validateQueue(queue);
         C consumer = (C) createConsumer(dest);
 
         return new QueueReceiverAdaptor(dest, consumer);
@@ -1363,11 +1363,23 @@ public abstract class AMQSession<C exten
     public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
     {
         checkNotClosed();
-        AMQQueue dest = (AMQQueue) queue;
+        Queue dest = validateQueue(queue);
         C consumer = (C) createConsumer(dest, messageSelector);
 
         return new QueueReceiverAdaptor(dest, consumer);
     }
+    
+    private Queue validateQueue(Destination dest) throws InvalidDestinationException
+    {
+        if (dest instanceof AMQDestination && dest instanceof javax.jms.Queue)
+        {
+            return (Queue)dest;
+        }
+        else
+        {
+            throw new InvalidDestinationException("The destination object used is not from this provider or of type javax.jms.Queue");
+        }
+    }
 
     public QueueSender createSender(Queue queue) throws JMSException
     {
@@ -1408,7 +1420,7 @@ public abstract class AMQSession<C exten
     public TopicSubscriber createSubscriber(Topic topic) throws JMSException
     {
         checkNotClosed();
-        AMQTopic dest = checkValidTopic(topic);
+        Topic dest = checkValidTopic(topic);
 
         // AMQTopic dest = new AMQTopic(topic.getTopicName());
         return new TopicSubscriberAdaptor(dest, (C) createExclusiveConsumer(dest));
@@ -1428,7 +1440,7 @@ public abstract class AMQSession<C exten
     public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
     {
         checkNotClosed();
-        AMQTopic dest = checkValidTopic(topic);
+        Topic dest = checkValidTopic(topic);
 
         // AMQTopic dest = new AMQTopic(topic.getTopicName());
         return new TopicSubscriberAdaptor(dest, (C) createExclusiveConsumer(dest, messageSelector, noLocal));
@@ -2395,7 +2407,7 @@ public abstract class AMQSession<C exten
     /*
      * I could have combined the last 3 methods, but this way it improves readability
      */
-    protected AMQTopic checkValidTopic(Topic topic, boolean durable) throws JMSException
+    protected Topic checkValidTopic(Topic topic, boolean durable) throws JMSException
     {
         if (topic == null)
         {
@@ -2414,17 +2426,17 @@ public abstract class AMQSession<C exten
                 ("Cannot create a durable subscription with a temporary topic: " + topic);
         }
 
-        if (!(topic instanceof AMQTopic))
+        if (!(topic instanceof AMQDestination && topic instanceof javax.jms.Topic))
         {
             throw new javax.jms.InvalidDestinationException(
                     "Cannot create a subscription on topic created for another JMS Provider, class of topic provided is: "
                     + topic.getClass().getName());
         }
 
-        return (AMQTopic) topic;
+        return topic;
     }
 
-    protected AMQTopic checkValidTopic(Topic topic) throws JMSException
+    protected Topic checkValidTopic(Topic topic) throws JMSException
     {
         return checkValidTopic(topic, false);
     }

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java Tue Mar 15 01:54:07 2011
@@ -47,6 +47,8 @@ import org.apache.qpid.client.message.AM
 import org.apache.qpid.client.message.FieldTableSupport;
 import org.apache.qpid.client.message.MessageFactoryRegistry;
 import org.apache.qpid.client.message.UnprocessedMessage_0_10;
+import org.apache.qpid.client.messaging.address.Link;
+import org.apache.qpid.client.messaging.address.Link.Reliability;
 import org.apache.qpid.client.messaging.address.Node.ExchangeNode;
 import org.apache.qpid.client.messaging.address.Node.QueueNode;
 import org.apache.qpid.client.protocol.AMQProtocolHandler;
@@ -56,6 +58,7 @@ import org.apache.qpid.framing.FieldTabl
 import org.apache.qpid.protocol.AMQConstant;
 import org.apache.qpid.transport.ExchangeBoundResult;
 import org.apache.qpid.transport.ExchangeQueryResult;
+import org.apache.qpid.transport.ExecutionErrorCode;
 import org.apache.qpid.transport.ExecutionException;
 import org.apache.qpid.transport.MessageAcceptMode;
 import org.apache.qpid.transport.MessageAcquireMode;
@@ -600,10 +603,16 @@ public class AMQSession_0_10 extends AMQ
                         (Map<? extends String, ? extends Object>) consumer.getDestination().getLink().getSubscription().getArgs());
             }
             
+            boolean acceptModeNone = getAcknowledgeMode() == NO_ACKNOWLEDGE;
+            
+            if (consumer.getDestination().getLink() != null)
+            {
+                acceptModeNone = consumer.getDestination().getLink().getReliability() == Link.Reliability.UNRELIABLE;
+            }
             
             getQpidSession().messageSubscribe
                 (queueName.toString(), String.valueOf(tag),
-                 getAcknowledgeMode() == NO_ACKNOWLEDGE ? MessageAcceptMode.NONE : MessageAcceptMode.EXPLICIT,
+                 acceptModeNone ? MessageAcceptMode.NONE : MessageAcceptMode.EXPLICIT,
                  preAcquire ? MessageAcquireMode.PRE_ACQUIRED : MessageAcquireMode.NOT_ACQUIRED, null, 0, arguments,
                  consumer.isExclusive() ? Option.EXCLUSIVE : Option.NONE);
         }
@@ -1068,22 +1077,37 @@ public class AMQSession_0_10 extends AMQ
         return match;
     }
     
-    public boolean isQueueExist(AMQDestination dest,QueueNode node,boolean assertNode)
+    public boolean isQueueExist(AMQDestination dest,QueueNode node,boolean assertNode) throws AMQException
     {
         boolean match = true;
-        QueueQueryResult result = getQpidSession().queueQuery(dest.getAddressName(), Option.NONE).get();
-        match = dest.getAddressName().equals(result.getQueue());
-        
-        if (match && assertNode)
+        try
         {
-            match = (result.getDurable() == node.isDurable()) && 
-                     (result.getAutoDelete() == node.isAutoDelete()) &&
-                     (result.getExclusive() == node.isExclusive()) &&
-                     (matchProps(result.getArguments(),node.getDeclareArgs()));
+            QueueQueryResult result = getQpidSession().queueQuery(dest.getAddressName(), Option.NONE).get();
+            match = dest.getAddressName().equals(result.getQueue());
+            
+            if (match && assertNode)
+            {
+                match = (result.getDurable() == node.isDurable()) && 
+                         (result.getAutoDelete() == node.isAutoDelete()) &&
+                         (result.getExclusive() == node.isExclusive()) &&
+                         (matchProps(result.getArguments(),node.getDeclareArgs()));
+            }
+            else if (match)
+            {
+                // should I use the queried details to update the local data structure.
+            }
         }
-        else if (match)
+        catch(SessionException e)
         {
-            // should I use the queried details to update the local data structure.
+            if (e.getException().getErrorCode() == ExecutionErrorCode.RESOURCE_DELETED)
+            {
+                match = false;
+            }
+            else
+            {
+                throw new AMQException(AMQConstant.getConstant(e.getException().getErrorCode().getValue()),
+                        "Error querying queue",e);
+            }
         }
         
         return match;
@@ -1149,6 +1173,22 @@ public class AMQSession_0_10 extends AMQ
             
             int type = resolveAddressType(dest);
             
+            if (type == AMQDestination.QUEUE_TYPE && 
+                    dest.getLink().getReliability() == Reliability.UNSPECIFIED)
+            {
+                dest.getLink().setReliability(Reliability.AT_LEAST_ONCE);
+            }
+            else if (type == AMQDestination.TOPIC_TYPE && 
+                    dest.getLink().getReliability() == Reliability.UNSPECIFIED)
+            {
+                dest.getLink().setReliability(Reliability.UNRELIABLE);
+            }
+            else if (type == AMQDestination.TOPIC_TYPE && 
+                    dest.getLink().getReliability() == Reliability.AT_LEAST_ONCE)
+            {
+                throw new AMQException("AT-LEAST-ONCE is not yet supported for Topics");                      
+            }
+            
             switch (type)
             {
                 case AMQDestination.QUEUE_TYPE: 

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java Tue Mar 15 01:54:07 2011
@@ -22,6 +22,7 @@ package org.apache.qpid.client;
 
 import java.net.URISyntaxException;
 
+import javax.jms.InvalidDestinationException;
 import javax.jms.JMSException;
 import javax.jms.Topic;
 
@@ -95,39 +96,47 @@ public class AMQTopic extends AMQDestina
         super(exchangeName, exchangeClass, routingKey, isExclusive, isAutoDelete, queueName, isDurable,bindingKeys);
     }
 
-    public static AMQTopic createDurableTopic(AMQTopic topic, String subscriptionName, AMQConnection connection)
+    public static AMQTopic createDurableTopic(Topic topic, String subscriptionName, AMQConnection connection)
             throws JMSException
     {
-        if (topic.getDestSyntax() == DestSyntax.ADDR)
+        if (topic instanceof AMQDestination && topic instanceof javax.jms.Topic)
         {
-            try
+            AMQDestination qpidTopic = (AMQDestination)topic;
+            if (qpidTopic.getDestSyntax() == DestSyntax.ADDR)
             {
-                AMQTopic t = new AMQTopic(topic.getAddress());
-                AMQShortString queueName = getDurableTopicQueueName(subscriptionName, connection);
-                // link is never null if dest was created using an address string.
-                t.getLink().setName(queueName.asString());               
-                t.getSourceNode().setAutoDelete(false);
-                t.getSourceNode().setDurable(true);
-                
-                // The legacy fields are also populated just in case.
-                t.setQueueName(queueName);
-                t.setAutoDelete(false);
-                t.setDurable(true);
-                return t;
+                try
+                {
+                    AMQTopic t = new AMQTopic(qpidTopic.getAddress());
+                    AMQShortString queueName = getDurableTopicQueueName(subscriptionName, connection);
+                    // link is never null if dest was created using an address string.
+                    t.getLink().setName(queueName.asString());               
+                    t.getSourceNode().setAutoDelete(false);
+                    t.getSourceNode().setDurable(true);
+                    
+                    // The legacy fields are also populated just in case.
+                    t.setQueueName(queueName);
+                    t.setAutoDelete(false);
+                    t.setDurable(true);
+                    return t;
+                }
+                catch(Exception e)
+                {
+                    JMSException ex = new JMSException("Error creating durable topic");
+                    ex.initCause(e);
+                    ex.setLinkedException(e);
+                    throw ex;
+                }
             }
-            catch(Exception e)
+            else
             {
-                JMSException ex = new JMSException("Error creating durable topic");
-                ex.initCause(e);
-                ex.setLinkedException(e);
-                throw ex;
+                return new AMQTopic(qpidTopic.getExchangeName(), qpidTopic.getRoutingKey(), false,
+                                getDurableTopicQueueName(subscriptionName, connection),
+                                true);
             }
         }
         else
         {
-            return new AMQTopic(topic.getExchangeName(), topic.getRoutingKey(), false,
-                            getDurableTopicQueueName(subscriptionName, connection),
-                            true);
+            throw new InvalidDestinationException("The destination object used is not from this provider or of type javax.jms.Topic");
         }
     }
 

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java Tue Mar 15 01:54:07 2011
@@ -571,6 +571,7 @@ public abstract class BasicMessageConsum
                         if (!_session.isClosed() || _session.isClosing())
                         {
                             sendCancel();
+                            cleanupQueue();
                         }
                     }
                     catch (AMQException e)
@@ -608,6 +609,8 @@ public abstract class BasicMessageConsum
     }
 
     abstract void sendCancel() throws AMQException, FailoverException;
+    
+    abstract void cleanupQueue() throws AMQException, FailoverException;
 
     /**
      * Called when you need to invalidate a consumer. Used for example when failover has occurred and the client has

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java Tue Mar 15 01:54:07 2011
@@ -19,8 +19,11 @@ package org.apache.qpid.client;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.apache.qpid.client.AMQDestination.AddressOption;
 import org.apache.qpid.client.AMQDestination.DestSyntax;
+import org.apache.qpid.client.failover.FailoverException;
 import org.apache.qpid.client.message.*;
+import org.apache.qpid.client.messaging.address.Node.QueueNode;
 import org.apache.qpid.client.protocol.AMQProtocolHandler;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
@@ -509,4 +512,18 @@ public class BasicMessageConsumer_0_10 e
             return _exclusive;
         }
     }
+    
+    void cleanupQueue() throws AMQException, FailoverException
+    {
+        AMQDestination dest = this.getDestination();
+        if (dest != null && dest.getDestSyntax() == AMQDestination.DestSyntax.ADDR)
+        {
+            if (dest.getDelete() == AddressOption.ALWAYS ||
+                dest.getDelete() == AddressOption.RECEIVER )
+            {
+                ((AMQSession_0_10) getSession()).getQpidSession().queueDelete(
+                        this.getDestination().getQueueName());
+            }
+        }
+    }
 }

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_8.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_8.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_8.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_8.java Tue Mar 15 01:54:07 2011
@@ -88,4 +88,8 @@ public class BasicMessageConsumer_0_8 ex
         return receive();
     }
 
+    void cleanupQueue() throws AMQException, FailoverException
+    {
+        
+    }
 }

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java Tue Mar 15 01:54:07 2011
@@ -19,6 +19,7 @@ package org.apache.qpid.client;
 
 import static org.apache.qpid.transport.Option.NONE;
 import static org.apache.qpid.transport.Option.SYNC;
+import static org.apache.qpid.transport.Option.UNRELIABLE;
 
 import java.nio.ByteBuffer;
 import java.util.HashMap;
@@ -30,9 +31,12 @@ import javax.jms.JMSException;
 import javax.jms.Message;
 
 import org.apache.qpid.AMQException;
+import org.apache.qpid.client.AMQDestination.AddressOption;
 import org.apache.qpid.client.AMQDestination.DestSyntax;
 import org.apache.qpid.client.message.AMQMessageDelegate_0_10;
 import org.apache.qpid.client.message.AbstractJMSMessage;
+import org.apache.qpid.client.messaging.address.Link.Reliability;
+import org.apache.qpid.client.messaging.address.Node.QueueNode;
 import org.apache.qpid.client.protocol.AMQProtocolHandler;
 import org.apache.qpid.transport.DeliveryProperties;
 import org.apache.qpid.transport.Header;
@@ -210,6 +214,9 @@ public class BasicMessageProducer_0_10 e
                          deliveryMode == DeliveryMode.PERSISTENT)
                    );  
             
+            boolean unreliable = (destination.getDestSyntax() == DestSyntax.ADDR) &&
+                                 (destination.getLink().getReliability() == Reliability.UNRELIABLE);
+            
             org.apache.mina.common.ByteBuffer data = message.getData();
             ByteBuffer buffer = data == null ? ByteBuffer.allocate(0) : data.buf().slice();
             
@@ -217,7 +224,7 @@ public class BasicMessageProducer_0_10 e
                                 MessageAcceptMode.NONE,
                                 MessageAcquireMode.PRE_ACQUIRED,
                                 new Header(deliveryProp, messageProps),
-                    buffer, sync ? SYNC : NONE);
+                    buffer, sync ? SYNC : NONE, unreliable ? UNRELIABLE : NONE);
             if (sync)
             {
                 ssn.sync();
@@ -239,5 +246,21 @@ public class BasicMessageProducer_0_10 e
     {
         return _session.isQueueBound(destination);
     }
+    
+    @Override
+    public void close()
+    {
+        super.close();
+        AMQDestination dest = _destination;
+        if (dest != null && dest.getDestSyntax() == AMQDestination.DestSyntax.ADDR)
+        {
+            if (dest.getDelete() == AddressOption.ALWAYS ||
+                dest.getDelete() == AddressOption.SENDER )
+            {
+                ((AMQSession_0_10) getSession()).getQpidSession().queueDelete(
+                        _destination.getQueueName());
+            }
+        }
+    }
 }
 

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java Tue Mar 15 01:54:07 2011
@@ -50,25 +50,25 @@ public class QueueSenderAdapter implemen
 
     public void send(Message msg) throws JMSException
     {
-        checkPreConditions();
+        checkQueuePreConditions(_queue);
         _delegate.send(msg);
     }
 
     public void send(Queue queue, Message msg) throws JMSException
     {
-        checkPreConditions(queue);
+        checkQueuePreConditions(queue);
         _delegate.send(queue, msg);
     }
 
     public void publish(Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
     {
-        checkPreConditions();
+        checkQueuePreConditions(_queue);
         _delegate.send(msg, deliveryMode, priority, timeToLive);
     }
 
     public void send(Queue queue, Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
     {
-        checkPreConditions(queue);
+        checkQueuePreConditions(queue);
         _delegate.send(queue, msg, deliveryMode, priority, timeToLive);
     }
 
@@ -122,19 +122,19 @@ public class QueueSenderAdapter implemen
 
     public void send(Destination dest, Message msg) throws JMSException
     {
-        checkPreConditions((Queue) dest);
+        checkQueuePreConditions((Queue) dest);
         _delegate.send(dest, msg);
     }
 
     public void send(Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
     {
-        checkPreConditions();
+        checkQueuePreConditions(_queue);
         _delegate.send(msg, deliveryMode, priority, timeToLive);
     }
 
     public void send(Destination dest, Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
     {
-        checkPreConditions((Queue) dest);
+        checkQueuePreConditions((Queue) dest);
         _delegate.send(dest, msg, deliveryMode, priority, timeToLive);
     }
 
@@ -170,11 +170,6 @@ public class QueueSenderAdapter implemen
 
     private void checkPreConditions() throws JMSException
     {
-        checkPreConditions(_queue);
-    }
-
-    private void checkPreConditions(Queue queue) throws JMSException
-    {
         if (closed)
         {
             throw new javax.jms.IllegalStateException("Publisher is closed");
@@ -186,39 +181,43 @@ public class QueueSenderAdapter implemen
         {
             throw new javax.jms.IllegalStateException("Invalid Session");
         }
+    }
 
-        if (queue == null)
-        {
-            throw new UnsupportedOperationException("Queue is null.");
-        }
-
-        if (!(queue instanceof AMQDestination))
-        {
-            throw new InvalidDestinationException("Queue: " + queue + " is not a valid Qpid queue");
-        }
-
-        AMQDestination destination = (AMQDestination) queue;
-        if (!destination.isCheckedForQueueBinding() && checkQueueBeforePublish())
-        {
-
-            if (_delegate.getSession().isStrictAMQP())
-            {
-                _delegate._logger.warn("AMQP does not support destination validation before publish, ");
-                destination.setCheckedForQueueBinding(true);
-            }
-            else
-            {
-                if (_delegate.isBound(destination))
-                {
-                    destination.setCheckedForQueueBinding(true);
-                }
-                else
-                {
-                    throw new InvalidDestinationException("Queue: " + queue
-                        + " is not a valid destination (no bindings on server");
-                }
-            }
-        }
+    private void checkQueuePreConditions(Queue queue) throws JMSException
+    {
+       checkPreConditions() ;
+       
+       if (queue == null)
+       {
+          throw new UnsupportedOperationException("Queue is null.");
+       }
+       
+       if (!(queue instanceof AMQDestination))
+       {
+           throw new InvalidDestinationException("Queue: " + queue + " is not a valid Qpid queue");
+       }
+  
+       AMQDestination destination = (AMQDestination) queue;
+       if (!destination.isCheckedForQueueBinding() && checkQueueBeforePublish())
+       {
+           if (_delegate.getSession().isStrictAMQP())
+           {
+               _delegate._logger.warn("AMQP does not support destination validation before publish, ");
+               destination.setCheckedForQueueBinding(true);
+           }
+           else
+           {
+               if (_delegate.isBound(destination))
+               {
+                   destination.setCheckedForQueueBinding(true);
+               }
+               else
+               {
+                   throw new InvalidDestinationException("Queue: " + queue
+                       + " is not a valid destination (no bindings on server");
+               }
+           }
+       }
     }
 
     private boolean checkQueueBeforePublish()

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java Tue Mar 15 01:54:07 2011
@@ -22,10 +22,12 @@
 package org.apache.qpid.client.message;
 
 import java.lang.ref.SoftReference;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
@@ -670,7 +672,19 @@ public class AMQMessageDelegate_0_10 ext
 
     public Enumeration getPropertyNames() throws JMSException
     {
-        return java.util.Collections.enumeration(getApplicationHeaders().keySet());
+        List<String> props = new ArrayList<String>();
+        Map<String, Object> propertyMap = getApplicationHeaders();
+        for (String prop: getApplicationHeaders().keySet())
+        {
+            Object value = propertyMap.get(prop);
+            if (value instanceof Boolean || value instanceof Number 
+                || value instanceof String)
+            {
+                props.add(prop);
+            }
+        }
+        
+        return java.util.Collections.enumeration(props);        
     }
 
     public void setBooleanProperty(String propertyName, boolean b) throws JMSException

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessage.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessage.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessage.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessage.java Tue Mar 15 01:54:07 2011
@@ -23,6 +23,7 @@ package org.apache.qpid.client.message;
 
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import javax.jms.JMSException;
 import javax.jms.MessageFormatException;
@@ -65,7 +66,7 @@ public class AMQPEncodedMapMessage exten
         if ((value instanceof Boolean) || (value instanceof Byte) || (value instanceof Short) || (value instanceof Integer)
                 || (value instanceof Long) || (value instanceof Character) || (value instanceof Float)
                 || (value instanceof Double) || (value instanceof String) || (value instanceof byte[])
-                || (value instanceof List) || (value instanceof Map) || (value == null))
+                || (value instanceof List) || (value instanceof Map) || (value instanceof UUID) || (value == null))
         {
             _map.put(propName, value);
         }

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java Tue Mar 15 01:54:07 2011
@@ -27,6 +27,7 @@ import java.util.Map;
 
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQDestination.Binding;
+import org.apache.qpid.client.messaging.address.Link.Reliability;
 import org.apache.qpid.client.messaging.address.Link.Subscription;
 import org.apache.qpid.client.messaging.address.Node.ExchangeNode;
 import org.apache.qpid.client.messaging.address.Node.QueueNode;
@@ -262,7 +263,7 @@ public class AddressHelper
         }
     }
 
-    public Link getLink()
+    public Link getLink() throws Exception
     {
         Link link = new Link();
         link.setSubscription(new Subscription());
@@ -272,6 +273,25 @@ public class AddressHelper
                     : linkProps.getBoolean(DURABLE));
             link.setName(linkProps.getString(NAME));
 
+            String reliability = linkProps.getString(RELIABILITY);
+            if ( reliability != null)
+            {
+                if (reliability.equalsIgnoreCase("unreliable"))
+                {
+                    link.setReliability(Reliability.UNRELIABLE);
+                }
+                else if (reliability.equalsIgnoreCase("at-least-once"))
+                {
+                    link.setReliability(Reliability.AT_LEAST_ONCE);
+                }
+                else
+                {
+                    throw new Exception("The reliability mode '" + 
+                            reliability + "' is not yet supported");
+                }
+                
+            }
+            
             if (((Map) address.getOptions().get(LINK)).get(CAPACITY) instanceof Map)
             {
                 MapAccessor capacityProps = new MapAccessor(

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/Link.java Tue Mar 15 01:54:07 2011
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.client.messaging.address;
 
+import static org.apache.qpid.client.messaging.address.Link.Reliability.UNSPECIFIED;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -29,6 +31,8 @@ public class Link
 { 
     public enum FilterType { SQL92, XQUERY, SUBJECT }
     
+    public enum Reliability { UNRELIABLE, AT_MOST_ONCE, AT_LEAST_ONCE, EXACTLY_ONCE, UNSPECIFIED }
+    
     protected String name;
     protected String _filter;
     protected FilterType _filterType = FilterType.SUBJECT;
@@ -38,7 +42,18 @@ public class Link
     protected int _producerCapacity = 0;
     protected Node node;
     protected Subscription subscription;
+    protected Reliability reliability = UNSPECIFIED;
     
+    public Reliability getReliability()
+    {
+        return reliability;
+    }
+
+    public void setReliability(Reliability reliability)
+    {
+        this.reliability = reliability;
+    }
+
     public Node getNode()
     {
         return node;

Modified: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties Tue Mar 15 01:54:07 2011
@@ -18,3 +18,4 @@
 #
 AMQPLAIN=org.apache.qpid.client.security.amqplain.AmqPlainSaslClientFactory
 CRAM-MD5-HASHED=org.apache.qpid.client.security.crammd5hashed.CRAMMD5HashedSaslClientFactory
+ANONYMOUS=org.apache.qpid.client.security.anonymous.AnonymousSaslClientFactory

Added: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClient.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClient.java?rev=1081634&view=auto
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClient.java (added)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClient.java Tue Mar 15 01:54:07 2011
@@ -0,0 +1,52 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.client.security.anonymous;
+
+import javax.security.sasl.SaslClient;
+import javax.security.sasl.SaslException;
+
+public class AnonymousSaslClient implements SaslClient
+{
+    public String getMechanismName() {
+        return "ANONYMOUS";
+    }
+    public boolean hasInitialResponse() {
+        return true;
+    }
+    public byte[] evaluateChallenge(byte[] challenge) throws SaslException {
+        return new byte[0];
+    }
+    public boolean isComplete() {
+        return true;
+    }
+    public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
+    {
+        throw new IllegalStateException("No security layer supported");
+    }
+    public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
+    {
+        throw new IllegalStateException("No security layer supported");
+    }
+    public Object getNegotiatedProperty(String propName) {
+        return null;
+    }
+    public void dispose() throws SaslException {}
+}

Propchange: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClient.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClientFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClientFactory.java?rev=1081634&view=auto
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClientFactory.java (added)
+++ qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClientFactory.java Tue Mar 15 01:54:07 2011
@@ -0,0 +1,52 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.client.security.anonymous;
+
+import java.util.Arrays;
+import java.util.Map;
+
+import javax.security.sasl.Sasl;
+import javax.security.sasl.SaslClient;
+import javax.security.sasl.SaslClientFactory;
+import javax.security.sasl.SaslException;
+import javax.security.auth.callback.CallbackHandler;
+
+public class AnonymousSaslClientFactory implements SaslClientFactory
+{
+    public SaslClient createSaslClient(String[] mechanisms, String authId,
+                                       String protocol, String server,
+                                       Map props, CallbackHandler cbh) throws SaslException
+    {
+        if (Arrays.asList(mechanisms).contains("ANONYMOUS")) {
+            return new AnonymousSaslClient();
+        } else {
+            return null;
+        }
+    }
+    public String[] getMechanismNames(Map props)
+    {
+        if (props == null || props.isEmpty()) {
+            return new String[]{"ANONYMOUS"};
+        } else {
+            return new String[0];
+        }
+    }
+}

Propchange: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClientFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/branches/qpid-2920/qpid/java/client/src/main/java/org/apache/qpid/client/security/anonymous/AnonymousSaslClientFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: qpid/branches/qpid-2920/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java (original)
+++ qpid/branches/qpid-2920/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java Tue Mar 15 01:54:07 2011
@@ -549,6 +549,37 @@ public class ConnectionURLTest extends T
         assertTrue("String representation should contain options and values", url.toString().contains("maxprefetch='12345'"));
     }
 
+    public void testHostNamesWithUnderScore() throws URLSyntaxException
+    {
+        String url = "amqp://guest:guest@clientid/test?brokerlist='tcp://under_score:6672'";
+
+        ConnectionURL connectionurl = new AMQConnectionURL(url);
+
+        assertTrue(connectionurl.getUsername().equals("guest"));
+        assertTrue(connectionurl.getPassword().equals("guest"));
+        assertTrue(connectionurl.getVirtualHost().equals("/test"));
+
+        assertTrue(connectionurl.getBrokerCount() == 1);
+        BrokerDetails service = connectionurl.getBrokerDetails(0);
+        assertTrue(service.getTransport().equals("tcp"));        
+        assertTrue(service.getHost().equals("under_score"));
+        assertTrue(service.getPort() == 6672);
+        
+        url = "amqp://guest:guest@clientid/test?brokerlist='tcp://under_score'";
+
+        connectionurl = new AMQConnectionURL(url);
+
+        assertTrue(connectionurl.getUsername().equals("guest"));
+        assertTrue(connectionurl.getPassword().equals("guest"));
+        assertTrue(connectionurl.getVirtualHost().equals("/test"));
+
+        assertTrue(connectionurl.getBrokerCount() == 1);
+        service = connectionurl.getBrokerDetails(0);
+        assertTrue(service.getTransport().equals("tcp"));        
+        assertTrue(service.getHost().equals("under_score"));
+        assertTrue(service.getPort() == 5672);
+    }
+    
     public static junit.framework.Test suite()
     {
         return new junit.framework.TestSuite(ConnectionURLTest.class);

Modified: qpid/branches/qpid-2920/qpid/java/common.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/common.xml?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/common.xml (original)
+++ qpid/branches/qpid-2920/qpid/java/common.xml Tue Mar 15 01:54:07 2011
@@ -23,7 +23,7 @@
   <dirname property="project.root" file="${ant.file.common}"/>
 
   <property name="project.name"          value="qpid"/>
-  <property name="project.version"       value="0.9"/>
+  <property name="project.version"       value="0.11"/>
   <property name="project.namever"       value="${project.name}-${project.version}"/>
 
   <property name="resources"             location="${project.root}/resources"/>

Modified: qpid/branches/qpid-2920/qpid/java/common/src/main/java/common.bnd
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/common/src/main/java/common.bnd?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/common/src/main/java/common.bnd (original)
+++ qpid/branches/qpid-2920/qpid/java/common/src/main/java/common.bnd Tue Mar 15 01:54:07 2011
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-ver: 0.9.0
+ver: 0.11.0
 
 Bundle-SymbolicName: qpid-common
 Bundle-Version: ${ver}

Modified: qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java (original)
+++ qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java Tue Mar 15 01:54:07 2011
@@ -28,6 +28,7 @@ import static org.apache.qpid.transport.
 import static org.apache.qpid.transport.Connection.State.RESUMING;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -695,4 +696,8 @@ public class Connection extends Connecti
         return connectionLost.get();
     }
 
+    protected Collection<Session> getChannels()
+    {
+        return channels.values();
+    }
 }

Modified: qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java (original)
+++ qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java Tue Mar 15 01:54:07 2011
@@ -422,7 +422,10 @@ public class Session extends SessionInvo
             {
                 return;
             }
-            sessionCompleted(copy, options);
+            if (copy.size() > 0)
+            {
+	            sessionCompleted(copy, options);
+            }
         }
     }
 
@@ -661,7 +664,12 @@ public class Session extends SessionInvo
                 {
                     sessionCommandPoint(0, 0);
                 }
-                if ((!closing && !transacted && m instanceof MessageTransfer) || m.hasCompletionListener())
+                
+                boolean replayTransfer = !closing && !transacted &&
+                                         m instanceof MessageTransfer &&
+                                         ! m.isUnreliable();
+                
+                if ((replayTransfer) || m.hasCompletionListener())
                 {
                     commands[mod(next, commands.length)] = m;
                     commandBytes += m.getBodySize();

Modified: qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java (original)
+++ qpid/branches/qpid-2920/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java Tue Mar 15 01:54:07 2011
@@ -63,6 +63,7 @@ abstract class AbstractEncoder implement
         ENCODINGS.put(Double.class, Type.DOUBLE);
         ENCODINGS.put(Character.class, Type.CHAR);
         ENCODINGS.put(byte[].class, Type.VBIN32);
+        ENCODINGS.put(UUID.class, Type.UUID);
     }
 
     private final Map<String,byte[]> str8cache = new LinkedHashMap<String,byte[]>()

Modified: qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/management-common.bnd
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/management-common.bnd?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/management-common.bnd (original)
+++ qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/management-common.bnd Tue Mar 15 01:54:07 2011
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-ver: 0.9.0
+ver: 0.11.0
 
 Bundle-SymbolicName: qpid-management-common
 Bundle-Version: ${ver}

Modified: qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java (original)
+++ qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java Tue Mar 15 01:54:07 2011
@@ -36,8 +36,8 @@ import org.apache.qpid.management.common
  * The ManagedBroker is the management interface to expose management
  * features of the Broker.
  *
- * @author   Bhupendra Bhardwaj
- * @version  0.1
+ * @version Qpid JMX API 2.1
+ * @since Qpid JMX API 1.3
  */
 public interface ManagedBroker
 {
@@ -131,4 +131,118 @@ public interface ManagedBroker
                          impact= MBeanOperationInfo.ACTION)
     void deleteQueue(@MBeanOperationParameter(name= ManagedQueue.TYPE, description="Queue Name")String queueName)
             throws IOException, JMException, MBeanException;
+    
+    /**
+     * Resets all message and data statistics for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanOperation(name="resetStatistics",
+                    description="Resets all message and data statistics for the virtual host",
+                    impact= MBeanOperationInfo.ACTION)
+    void resetStatistics() throws Exception;
+
+    /**
+     * Peak rate of messages delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakMessageDeliveryRate", description=TYPE + " Peak Message Delivery Rate")
+    double getPeakMessageDeliveryRate();
+
+    /**
+     * Peak rate of bytes delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakDataDeliveryRate", description=TYPE + " Peak Data Delivery Rate")
+    double getPeakDataDeliveryRate();
+
+    /**
+     * Rate of messages delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="MessageDeliveryRate", description=TYPE + " Message Delivery Rate")
+    double getMessageDeliveryRate();
+
+    /**
+     * Rate of bytes delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="DataDeliveryRate", description=TYPE + " Data Delivery Rate")
+    double getDataDeliveryRate();
+
+    /**
+     * Total count of messages delivered for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalMessagesDelivered", description=TYPE + " Total Messages Delivered")
+    long getTotalMessagesDelivered();
+
+    /**
+     * Total count of bytes for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalDataDelivered", description=TYPE + " Total Data Delivered")
+    long getTotalDataDelivered();
+
+    /**
+     * Peak rate of messages received per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakMessageReceiptRate", description=TYPE + " Peak Message Receipt Rate")
+    double getPeakMessageReceiptRate();
+
+    /**
+     * Peak rate of bytes received per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakDataReceiptRate", description=TYPE + " Peak Data Receipt Rate")
+    double getPeakDataReceiptRate();
+
+    /**
+     * Rate of messages received per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="MessageReceiptRate", description=TYPE + " Message Receipt Rate")
+    double getMessageReceiptRate();
+
+    /**
+     * Rate of bytes received per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="DataReceiptRate", description=TYPE + " Data Receipt Rate")
+    double getDataReceiptRate();
+
+    /**
+     * Total count of messages received for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalMessagesReceived", description=TYPE + " Total Messages Received")
+    long getTotalMessagesReceived();
+
+    /**
+     * Total count of bytes received for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalDataReceived", description=TYPE + " Total Data Received")
+    long getTotalDataReceived();
+
+    /**
+     * Is statistics collection enabled for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="StatisticsEnabled", description=TYPE + " Statistics Enabled")
+    boolean isStatisticsEnabled();
 }

Modified: qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java (original)
+++ qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java Tue Mar 15 01:54:07 2011
@@ -37,8 +37,9 @@ import org.apache.qpid.management.common
 
 /**
  * The management interface exposed to allow management of Connections.
- * @author   Bhupendra Bhardwaj
- * @version  0.1
+ * 
+ * @version Qpid JMX API 2.1
+ * @since Qpid JMX API 1.3
  */
 public interface ManagedConnection
 {
@@ -145,4 +146,120 @@ public interface ManagedConnection
                     description="Closes this connection and all related channels",
                     impact= MBeanOperationInfo.ACTION)
     void closeConnection() throws Exception;
+ 
+    /**
+     * Resets message and data statistics for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanOperation(name="resetStatistics",
+                    description="Resets message and data statistics for this connection",
+                    impact= MBeanOperationInfo.ACTION)
+    void resetStatistics() throws Exception;
+
+    /**
+     * Peak rate of messages delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakMessageDeliveryRate", description=TYPE + " Peak Message Delivery Rate")
+    double getPeakMessageDeliveryRate();
+
+    /**
+     * Peak rate of bytes delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakDataDeliveryRate", description=TYPE + " Peak Data Delivery Rate")
+    double getPeakDataDeliveryRate();
+
+    /**
+     * Rate of messages delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="MessageDeliveryRate", description=TYPE + " Message Delivery Rate")
+    double getMessageDeliveryRate();
+
+    /**
+     * Rate of bytes delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="DataDeliveryRate", description=TYPE + " Data Delivery Rate")
+    double getDataDeliveryRate();
+
+    /**
+     * Total count of messages delivered for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalMessagesDelivered", description=TYPE + " Total Messages Delivered")
+    long getTotalMessagesDelivered();
+
+    /**
+     * Total count of bytes for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalDataDelivered", description=TYPE + " Total Data Delivered")
+    long getTotalDataDelivered();
+
+    /**
+     * Peak rate of messages received per second for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakMessageReceiptRate", description=TYPE + " Peak Message Receipt Rate")
+    double getPeakMessageReceiptRate();
+
+    /**
+     * Peak rate of bytes received per second for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakDataReceiptRate", description=TYPE + " Peak Data Receipt Rate")
+    double getPeakDataReceiptRate();
+
+    /**
+     * Rate of messages received per second for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="MessageReceiptRate", description=TYPE + " Message Receipt Rate")
+    double getMessageReceiptRate();
+
+    /**
+     * Rate of bytes received per second for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="DataReceiptRate", description=TYPE + " Data Receipt Rate")
+    double getDataReceiptRate();
+
+    /**
+     * Total count of messages received for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalMessagesReceived", description=TYPE + " Total Messages Received")
+    long getTotalMessagesReceived();
+
+    /**
+     * Total count of bytes received for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalDataReceived", description=TYPE + " Total Data Received")
+    long getTotalDataReceived();
+
+    /**
+     * Is statistics collection enabled for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="StatisticsEnabled", description=TYPE + " Statistics Enabled")
+    boolean isStatisticsEnabled();
+    
+    void setStatisticsEnabled(boolean enabled);
 }

Modified: qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java (original)
+++ qpid/branches/qpid-2920/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ServerInformation.java Tue Mar 15 01:54:07 2011
@@ -22,10 +22,15 @@ package org.apache.qpid.management.commo
 
 import java.io.IOException;
 
+import javax.management.MBeanOperationInfo;
+
 import org.apache.qpid.management.common.mbeans.annotations.MBeanAttribute;
+import org.apache.qpid.management.common.mbeans.annotations.MBeanOperation;
 
 /**
  * Interface for the ServerInformation MBean
+ * 
+ * @version Qpid JMX API 2.1
  * @since Qpid JMX API 1.3
  */
 public interface ServerInformation
@@ -42,7 +47,7 @@ public interface ServerInformation
      *  Qpid JMX API 1.1 can be assumed.
      */
     int QPID_JMX_API_MAJOR_VERSION = 2;
-    int QPID_JMX_API_MINOR_VERSION = 0;
+    int QPID_JMX_API_MINOR_VERSION = 1;
     
     
     /**
@@ -80,4 +85,118 @@ public interface ServerInformation
     @MBeanAttribute(name="ProductVersion", 
                     description = "The product version string")
     String getProductVersion() throws IOException;
+    
+    /**
+     * Resets all message and data statistics for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanOperation(name="resetStatistics",
+                    description="Resets all message and data statistics for the broker",
+                    impact= MBeanOperationInfo.ACTION)
+    void resetStatistics() throws Exception;
+
+    /**
+     * Peak rate of messages delivered per second for the virtual host.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakMessageDeliveryRate", description=TYPE + " Peak Message Delivery Rate")
+    double getPeakMessageDeliveryRate();
+
+    /**
+     * Peak rate of bytes delivered per second for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakDataDeliveryRate", description=TYPE + " Peak Data Delivery Rate")
+    double getPeakDataDeliveryRate();
+
+    /**
+     * Rate of messages delivered per second for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="MessageDeliveryRate", description=TYPE + " Message Delivery Rate")
+    double getMessageDeliveryRate();
+
+    /**
+     * Rate of bytes delivered per second for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="DataDeliveryRate", description=TYPE + " Data Delivery Rate")
+    double getDataDeliveryRate();
+
+    /**
+     * Total count of messages delivered for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalMessagesDelivered", description=TYPE + " Total Messages Delivered")
+    long getTotalMessagesDelivered();
+
+    /**
+     * Total count of bytes for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalDataDelivered", description=TYPE + " Total Data Delivered")
+    long getTotalDataDelivered();
+
+    /**
+     * Peak rate of messages received per second for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakMessageReceiptRate", description=TYPE + " Peak Message Receipt Rate")
+    double getPeakMessageReceiptRate();
+
+    /**
+     * Peak rate of bytes received per second for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="PeakDataReceiptRate", description=TYPE + " Peak Data Receipt Rate")
+    double getPeakDataReceiptRate();
+
+    /**
+     * Rate of messages received per second for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="MessageReceiptRate", description=TYPE + " Message Receipt Rate")
+    double getMessageReceiptRate();
+
+    /**
+     * Rate of bytes received per second for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="DataReceiptRate", description=TYPE + " Data Receipt Rate")
+    double getDataReceiptRate();
+
+    /**
+     * Total count of messages received for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalMessagesReceived", description=TYPE + " Total Messages Received")
+    long getTotalMessagesReceived();
+
+    /**
+     * Total count of bytes received for the broker.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="TotalDataReceived", description=TYPE + " Total Data Received")
+    long getTotalDataReceived();
+
+    /**
+     * Is statistics collection enabled for this connection.
+     * 
+     * @since Qpid JMX API 2.1
+     */
+    @MBeanAttribute(name="StatisticsEnabled", description=TYPE + " Statistics Enabled")
+    boolean isStatisticsEnabled();
 }

Modified: qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/META-INF/MANIFEST.MF?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/META-INF/MANIFEST.MF (original)
+++ qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/META-INF/MANIFEST.MF Tue Mar 15 01:54:07 2011
@@ -3,7 +3,7 @@ Bundle-License: http://www.apache.org/li
 Bundle-ManifestVersion: 2
 Bundle-Name: Qpid JMX Management Console Plug-in
 Bundle-SymbolicName: org.apache.qpid.management.ui; singleton:=true
-Bundle-Version: 0.9.0
+Bundle-Version: 0.11.0
 Bundle-Activator: org.apache.qpid.management.ui.Activator
 Bundle-Vendor: Apache Software Foundation
 Bundle-Localization: plugin

Modified: qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java (original)
+++ qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java Tue Mar 15 01:54:07 2011
@@ -47,7 +47,7 @@ public abstract class ApplicationRegistr
 
     //max supported broker management interface supported by this release of the management console
     public static final int SUPPORTED_QPID_JMX_API_MAJOR_VERSION = 2;
-    public static final int SUPPORTED_QPID_JMX_API_MINOR_VERSION = 0;
+    public static final int SUPPORTED_QPID_JMX_API_MINOR_VERSION = 1;
     
     public static final String DATA_DIR = System.getProperty("user.home") + File.separator + ".qpidmc";
     

Modified: qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java (original)
+++ qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java Tue Mar 15 01:54:07 2011
@@ -21,6 +21,7 @@
 package org.apache.qpid.management.ui.jmx;
 
 import java.util.HashMap;
+import java.util.Map;
 
 import javax.management.ObjectName;
 
@@ -31,14 +32,36 @@ public class JMXManagedObject extends Ma
 {
     private ObjectName _objName;
     
-    @SuppressWarnings("unchecked")
     public JMXManagedObject(ObjectName objName)
     {
         super();
         this._objName = objName;
         setUniqueName(_objName.toString());
-        setDomain(_objName.getDomain());       
-        super.setProperties(new HashMap(_objName.getKeyPropertyList()));
+        setDomain(_objName.getDomain());
+
+        HashMap<String,String> props = new HashMap<String,String>(_objName.getKeyPropertyList());
+
+        for(Map.Entry<String,String> entry : props.entrySet())
+        {
+            String value = entry.getValue();
+
+            if(value != null)
+            {
+                try
+                {
+                    //if the name is quoted in the ObjectName, unquote it
+                    value = ObjectName.unquote(value);
+                    entry.setValue(value);
+                }
+                catch(IllegalArgumentException e)
+                {
+                    //ignore, this just means the name is not quoted
+                    //and can be left unchanged
+                }
+            }
+        }
+
+        super.setProperties(props);
     }
     
     public ObjectName getObjectName()

Modified: qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java (original)
+++ qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java Tue Mar 15 01:54:07 2011
@@ -61,7 +61,7 @@ public class NotificationObject
     {
         if (_source instanceof ObjectName)
         {
-            return ((ObjectName)_source).getKeyProperty("name");
+            return unquote(((ObjectName)_source).getKeyProperty("name"));
         }
         
         return null;
@@ -71,12 +71,31 @@ public class NotificationObject
     {
         if (_source instanceof ObjectName)
         {
-            return ((ObjectName)_source).getKeyProperty(VIRTUAL_HOST);
+            return unquote(((ObjectName)_source).getKeyProperty(VIRTUAL_HOST));
         }
         
         return null;
     }
-    
+
+    private String unquote(String value)
+    {
+        if(value != null)
+        {
+            try
+            {
+                //if the value is quoted in the ObjectName, unquote it
+                value = ObjectName.unquote(value);
+            }
+            catch(IllegalArgumentException e)
+            {
+                //ignore, this just means the value is not quoted
+                //and can be left unchanged
+            }
+        }
+
+        return value;
+    }
+
     public String getMessage()
     {
         return _message;

Modified: qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTabFolderFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTabFolderFactory.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTabFolderFactory.java (original)
+++ qpid/branches/qpid-2920/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTabFolderFactory.java Tue Mar 15 01:54:07 2011
@@ -131,6 +131,8 @@ public class MBeanTabFolderFactory
                 }
                 break;
             case VHOST_MANAGER:
+                createAttributesTab(tabFolder, mbean);
+
                 tab = new TabItem(tabFolder, SWT.NONE);
                 tab.setText("Operations");
                 controller = new VHostTabControl(tabFolder, mbean, mbsc);

Modified: qpid/branches/qpid-2920/qpid/java/module.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/module.xml?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/module.xml (original)
+++ qpid/branches/qpid-2920/qpid/java/module.xml Tue Mar 15 01:54:07 2011
@@ -401,6 +401,15 @@
 
   </target>
 
+  <target name="report-module" description="generate junit reports for each module">
+    <junitreport todir="${module.results}">
+        <fileset dir="${module.results}">
+            <include name="TEST-*.xml"/>
+        </fileset>
+        <report format="frames" todir="${module.results}/report/html"/>
+    </junitreport> 
+  </target>
+
   <target name="touch-failed" if="test.failures">
     <touch file="${module.failed}"/>
     <touch file="${build.failed}"/>

Modified: qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessageTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessageTest.java?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessageTest.java (original)
+++ qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/client/message/AMQPEncodedMapMessageTest.java Tue Mar 15 01:54:07 2011
@@ -27,6 +27,7 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import javax.jms.Connection;
 import javax.jms.JMSException;
@@ -51,6 +52,7 @@ public class AMQPEncodedMapMessageTest e
     private Session _session;
     MessageConsumer _consumer;
     MessageProducer _producer;
+    UUID myUUID = UUID.randomUUID();
     
     public void setUp() throws Exception
     {
@@ -119,7 +121,8 @@ public class AMQPEncodedMapMessageTest e
         m.setFloat("Float", Integer.MAX_VALUE + 5000);
         m.setInt("Int", Integer.MAX_VALUE - 5000);
         m.setShort("Short", (short)58);
-        m.setString("String", "Hello");            
+        m.setString("String", "Hello"); 
+        m.setObject("uuid", myUUID);
         _producer.send(m);
         
         AMQPEncodedMapMessage msg = (AMQPEncodedMapMessage)_consumer.receive(RECEIVE_TIMEOUT);
@@ -140,6 +143,7 @@ public class AMQPEncodedMapMessageTest e
         assertEquals(Integer.MAX_VALUE - 5000,m.getInt("Int"));
         assertEquals((short)58,m.getShort("Short"));
         assertEquals("Hello",m.getString("String"));
+        assertEquals(myUUID,(UUID)m.getObject("uuid"));
     }
     
     
@@ -149,7 +153,11 @@ public class AMQPEncodedMapMessageTest e
         
         List<Integer> myList = getList();
         
-        m.setObject("List", myList);            
+        m.setObject("List", myList);   
+        
+        List<UUID> uuidList = new ArrayList<UUID>();
+        uuidList.add(myUUID);
+        m.setObject("uuid-list", uuidList);
         _producer.send(m);
         
         AMQPEncodedMapMessage msg = (AMQPEncodedMapMessage)_consumer.receive(RECEIVE_TIMEOUT);
@@ -167,6 +175,10 @@ public class AMQPEncodedMapMessageTest e
             assertEquals(i,j.intValue());
             i++;
         }
+        
+        List<UUID> list2 = (List<UUID>)msg.getObject("uuid-list");
+        assertNotNull("UUID List not received",list2);
+        assertEquals(myUUID,list2.get(0));        
     }
     
     public void testMessageWithMapEntries() throws JMSException
@@ -174,8 +186,12 @@ public class AMQPEncodedMapMessageTest e
         MapMessage m = _session.createMapMessage();
         
         Map<String,String> myMap = getMap();
+        m.setObject("Map", myMap);          
+        
+        Map<String,UUID> uuidMap = new HashMap<String,UUID>();
+        uuidMap.put("uuid", myUUID);
+        m.setObject("uuid-map", uuidMap);      
         
-        m.setObject("Map", myMap);            
         _producer.send(m);
         
         AMQPEncodedMapMessage msg = (AMQPEncodedMapMessage)_consumer.receive(RECEIVE_TIMEOUT);
@@ -191,6 +207,10 @@ public class AMQPEncodedMapMessageTest e
             assertEquals("String" + i,map.get("Key" + i));
             i++;
         }
+        
+        Map<String,UUID> map2 = (Map<String,UUID>)msg.getObject("uuid-map");
+        assertNotNull("Map not received",map2);
+        assertEquals(myUUID,map2.get("uuid"));   
     }
     
     public void testMessageWithNestedListsAndMaps() throws JMSException

Added: qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageConnectionStatisticsTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageConnectionStatisticsTest.java?rev=1081634&view=auto
==============================================================================
--- qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageConnectionStatisticsTest.java (added)
+++ qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageConnectionStatisticsTest.java Tue Mar 15 01:54:07 2011
@@ -0,0 +1,102 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.management.jmx;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jms.Connection;
+
+import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.management.common.mbeans.ManagedBroker;
+import org.apache.qpid.management.common.mbeans.ManagedConnection;
+
+/**
+ * Test enabling generation of message statistics on a per-connection basis.
+ */
+public class MessageConnectionStatisticsTest extends MessageStatisticsTestCase
+{
+    public void configureStatistics() throws Exception
+    {
+        // no statistics generation configured
+    }
+
+    /**
+     * Test statistics on a single connection
+     */
+    public void testEnablingStatisticsPerConnection() throws Exception
+    {
+        ManagedBroker vhost = _jmxUtils.getManagedBroker("test");
+        
+        sendUsing(_test, 5, 200);
+        Thread.sleep(1000);
+        
+        List<String> addresses = new ArrayList<String>();
+        for (ManagedConnection mc : _jmxUtils.getManagedConnections("test"))
+        {
+	        assertEquals("Incorrect connection total", 0,  mc.getTotalMessagesReceived());
+	        assertEquals("Incorrect connection data", 0, mc.getTotalDataReceived());
+	        assertFalse("Connection statistics should not be enabled", mc.isStatisticsEnabled());
+            
+            addresses.add(mc.getRemoteAddress());
+        }
+        assertEquals("Incorrect vhost total", 0, vhost.getTotalMessagesReceived());
+        assertEquals("Incorrect vhost data", 0, vhost.getTotalDataReceived());
+        
+        Connection test = new AMQConnection(_brokerUrl, USER, USER, "clientid", "test");
+        test.start();
+        for (ManagedConnection mc : _jmxUtils.getManagedConnections("test"))
+        {
+            if (addresses.contains(mc.getRemoteAddress()))
+            {
+                continue;
+            }
+            mc.setStatisticsEnabled(true);
+	        assertEquals("Incorrect connection total", 0,  mc.getTotalMessagesReceived());
+	        assertEquals("Incorrect connection data", 0, mc.getTotalDataReceived());
+        }
+        
+        sendUsing(test, 5, 200);
+        sendUsing(_test, 5, 200);
+        Thread.sleep(1000);
+        
+        for (ManagedConnection mc : _jmxUtils.getManagedConnections("test"))
+        {
+            if (addresses.contains(mc.getRemoteAddress()))
+            {
+		        assertEquals("Incorrect connection total", 0,  mc.getTotalMessagesReceived());
+		        assertEquals("Incorrect connection data", 0, mc.getTotalDataReceived());
+		        assertFalse("Connection statistics should not be enabled", mc.isStatisticsEnabled());
+            }
+            else
+            {
+		        assertEquals("Incorrect connection total", 5,  mc.getTotalMessagesReceived());
+		        assertEquals("Incorrect connection data", 1000, mc.getTotalDataReceived());
+		        assertTrue("Connection statistics should be enabled", mc.isStatisticsEnabled());
+            }
+        }
+        assertEquals("Incorrect vhost total", 0, vhost.getTotalMessagesReceived());
+        assertEquals("Incorrect vhost data", 0, vhost.getTotalDataReceived());
+        assertFalse("Vhost statistics should not be enabled", vhost.isStatisticsEnabled());
+        
+        test.close();
+    }
+}

Propchange: qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageConnectionStatisticsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/branches/qpid-2920/qpid/java/systests/src/main/java/org/apache/qpid/management/jmx/MessageConnectionStatisticsTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message