Author: rajith
Date: Wed Apr  4 14:03:24 2012
New Revision: 1309392

URL: http://svn.apache.org/viewvc?rev=1309392&view=rev
Log:
QPID-3401 Added implementations for TemporaryQueue and TemporaryTopic.
Generating temp queue name, topic name as well as deleting temp
destinations is abstracted via the TemporaryDestinationProvider
interface. This keeps the Destination implementation independent of any
session implementation. These classes can then be used with the old
AMQSessionxx variants or with any new implementation.

Added:
    
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryQueue.java
    
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryTopic.java
    
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/TemporaryDestinationProvider.java

Added: 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryQueue.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryQueue.java?rev=1309392&view=auto
==============================================================================
--- 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryQueue.java
 (added)
+++ 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryQueue.java
 Wed Apr  4 14:03:24 2012
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.jms;
+
+import javax.jms.JMSException;
+import javax.jms.TemporaryQueue;
+
+public class QpidTemporaryQueue extends QpidQueue implements TemporaryQueue
+{
+    TemporaryDestinationProvider provider;
+
+    public QpidTemporaryQueue(TemporaryDestinationProvider provider) throws 
JMSException
+    {
+        super(provider.generateTempQueueAddress());
+        this.provider = provider;
+    }
+
+    @Override
+    public void delete() throws JMSException
+    {
+        provider.delete();
+    }
+
+}

Added: 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryTopic.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryTopic.java?rev=1309392&view=auto
==============================================================================
--- 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryTopic.java
 (added)
+++ 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/QpidTemporaryTopic.java
 Wed Apr  4 14:03:24 2012
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.jms;
+
+import javax.jms.JMSException;
+import javax.jms.TemporaryTopic;
+
+public class QpidTemporaryTopic extends QpidTopic implements TemporaryTopic
+{
+    TemporaryDestinationProvider provider;
+
+    public QpidTemporaryTopic(TemporaryDestinationProvider provider) throws 
JMSException
+    {
+        super(provider.generateTempTopicAddress());
+        this.provider = provider;
+    }
+
+    @Override
+    public void delete() throws JMSException
+    {
+        provider.delete();
+    }
+
+}

Added: 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/TemporaryDestinationProvider.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/TemporaryDestinationProvider.java?rev=1309392&view=auto
==============================================================================
--- 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/TemporaryDestinationProvider.java
 (added)
+++ 
qpid/branches/address-refactor2/qpid/java/client/src/main/java/org/apache/qpid/jms/TemporaryDestinationProvider.java
 Wed Apr  4 14:03:24 2012
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.jms;
+
+import javax.jms.JMSException;
+
+public interface TemporaryDestinationProvider
+{
+    public String generateTempQueueAddress();
+
+    public String generateTempTopicAddress();
+
+    public void delete() throws JMSException;
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to