summaryrefslogtreecommitdiff
path: root/java/client/src
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2007-02-21 17:21:41 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2007-02-21 17:21:41 +0000
commit0ce26f74e768466be14f53d660a241747e86c9f7 (patch)
treea83034bb676d1eb25d2d1147875a7877337a33c1 /java/client/src
parent2c4fdf9d81d32dd5c319714a86d3ab9ab5a6664e (diff)
downloadqpid-python-0ce26f74e768466be14f53d660a241747e86c9f7.tar.gz
Added the Session Adpater to the branch. It was taken from the trunk
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@510107 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src')
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java7
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java26
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java7
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/handler/MessageTransferMethodHandler.java1
4 files changed, 38 insertions, 3 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java b/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java
index 05071bd2a8..b6bfd0b174 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java
@@ -28,7 +28,7 @@ import java.io.Serializable;
* Need this adaptor class to conform to JMS spec and throw IllegalStateException
* from createDurableSubscriber, unsubscribe, createTopic & createTemporaryTopic
*/
-public class AMQQueueSessionAdaptor implements QueueSession
+public class AMQQueueSessionAdaptor implements QueueSession, AMQSessionAdapter
{
//holds a session for delegation
protected final AMQSession _session;
@@ -175,5 +175,10 @@ public class AMQQueueSessionAdaptor implements QueueSession
public void unsubscribe(String string) throws JMSException {
throw new IllegalStateException("Cannot call unsubscribe from QueueSession");
}
+
+ public AMQSession getSession()
+ {
+ return _session;
+ }
}
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java b/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java
new file mode 100644
index 0000000000..b4338f19d0
--- /dev/null
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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;
+
+public interface AMQSessionAdapter
+{
+ public AMQSession getSession();
+} \ No newline at end of file
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java b/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java
index 0f50c330fb..2ec88fd9a4 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java
@@ -24,7 +24,7 @@ import javax.jms.*;
import javax.jms.IllegalStateException;
import java.io.Serializable;
-public class AMQTopicSessionAdaptor implements TopicSession
+public class AMQTopicSessionAdaptor implements TopicSession, AMQSessionAdapter
{
protected final AMQSession _session;
@@ -198,5 +198,10 @@ public class AMQTopicSessionAdaptor implements TopicSession
{
throw new IllegalStateException("Cannot call createTemporaryQueue from TopicSession");
}
+
+ public AMQSession getSession()
+ {
+ return _session;
+ }
}
diff --git a/java/client/src/main/java/org/apache/qpid/client/handler/MessageTransferMethodHandler.java b/java/client/src/main/java/org/apache/qpid/client/handler/MessageTransferMethodHandler.java
index c274facad5..aee699787f 100644
--- a/java/client/src/main/java/org/apache/qpid/client/handler/MessageTransferMethodHandler.java
+++ b/java/client/src/main/java/org/apache/qpid/client/handler/MessageTransferMethodHandler.java
@@ -83,4 +83,3 @@ public class MessageTransferMethodHandler implements StateAwareMethodListener
}
}
-