qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r588642 - in /incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client: AMQSession.java AMQSession_0_10.java AMQSession_0_8.java
Date Fri, 26 Oct 2007 13:50:40 GMT
Author: arnaudsimon
Date: Fri Oct 26 06:50:39 2007
New Revision: 588642

URL: http://svn.apache.org/viewvc?rev=588642&view=rev
Log:
Changed the way temporary queues are created so that we can porduce before creating a consumer

Modified:
    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/AMQSession_0_10.java
    incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=588642&r1=588641&r2=588642&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
Fri Oct 26 06:50:39 2007
@@ -1038,13 +1038,8 @@
         return new TopicSubscriberAdaptor(dest, (BasicMessageConsumer) createConsumer(dest,
messageSelector, noLocal));
     }
 
-    public TemporaryQueue createTemporaryQueue() throws JMSException
-    {
-        checkNotClosed();
-
-        return new AMQTemporaryQueue(this);
-    }
-
+    public abstract TemporaryQueue createTemporaryQueue() throws JMSException;
+   
     public TemporaryTopic createTemporaryTopic() throws JMSException
     {
         checkNotClosed();

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java?rev=588642&r1=588641&r2=588642&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
Fri Oct 26 06:50:39 2007
@@ -40,6 +40,7 @@
 
 import javax.jms.JMSException;
 import javax.jms.Destination;
+import javax.jms.TemporaryQueue;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.UUID;
 import java.util.Map;
@@ -514,6 +515,28 @@
                                    toBeTrhown.getMessage(), toBeTrhown);
         }
     }
+
+
+     public TemporaryQueue createTemporaryQueue() throws JMSException
+    {
+        checkNotClosed();
+        AMQTemporaryQueue result = new AMQTemporaryQueue(this);
+        try
+        {
+            // this is done so that we can produce to a temporary queue beofre we create
a consumer
+            sendCreateQueue(result.getDestinationName(), result.isAutoDelete(), result.isDurable(),
result.isExclusive());
+            sendQueueBind(result.getDestinationName(), result.getDestinationName(), new FieldTable(),
result.getExchangeName());
+            result.setQueueName(result.getDestinationName());
+        }
+        catch (Exception e)
+        {
+           throw new JMSException("Cannot create temporary queue" );
+        }
+        return result;
+    }
+
+
+
 
     //------ Inner classes
     /**

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java?rev=588642&r1=588641&r2=588642&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
Fri Oct 26 06:50:39 2007
@@ -23,6 +23,7 @@
 
 import javax.jms.Destination;
 import javax.jms.JMSException;
+import javax.jms.TemporaryQueue;
 
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.failover.FailoverException;
@@ -324,5 +325,12 @@
     {
         _connection.getProtocolHandler().syncWrite(TxRollbackBody.createAMQFrame(_channelId,
             getProtocolMajorVersion(), getProtocolMinorVersion()), TxRollbackOkBody.class);
+    }
+
+     public TemporaryQueue createTemporaryQueue() throws JMSException
+    {
+        checkNotClosed();
+
+        return new AMQTemporaryQueue(this);
     }
 }



Mime
View raw message