View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.jms;
8   
9   import org.apache.commons.logging.Log;
10  import org.apache.commons.logging.LogFactory;
11  
12  import javax.jms.*;
13  import java.io.Serializable;
14  
15  public class ReusableQueueSessionWrapper implements QueueSession
16  {
17      protected transient Log logger = LogFactory.getLog(getClass());
18  
19      private QueueSession delegateSession;
20  
21      ReusableQueueSessionWrapper(QueueSession delegateSession)
22      {
23          this.delegateSession = delegateSession;
24      }
25  
26      public Queue createQueue(String queueName) throws JMSException
27      {
28          return delegateSession.createQueue(queueName);
29      }
30  
31      public QueueReceiver createReceiver(Queue queue) throws JMSException
32      {
33          return delegateSession.createReceiver(queue);
34      }
35  
36      public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
37      {
38          return delegateSession.createReceiver(queue, messageSelector);
39      }
40  
41      public QueueSender createSender(Queue queue) throws JMSException
42      {
43          return delegateSession.createSender(queue);
44      }
45  
46      public QueueBrowser createBrowser(Queue queue) throws JMSException
47      {
48          return delegateSession.createBrowser(queue);
49      }
50  
51      public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
52      {
53          return delegateSession.createBrowser(queue, messageSelector);
54      }
55  
56      public TemporaryQueue createTemporaryQueue() throws JMSException
57      {
58          return delegateSession.createTemporaryQueue();
59      }
60  
61      public BytesMessage createBytesMessage() throws JMSException
62      {
63          return delegateSession.createBytesMessage();
64      }
65  
66      public MapMessage createMapMessage() throws JMSException
67      {
68          return delegateSession.createMapMessage();
69      }
70  
71      public Message createMessage() throws JMSException
72      {
73          return delegateSession.createMessage();
74      }
75  
76      public ObjectMessage createObjectMessage() throws JMSException
77      {
78          return delegateSession.createObjectMessage();
79      }
80  
81      public ObjectMessage createObjectMessage(Serializable object) throws JMSException
82      {
83          return delegateSession.createObjectMessage(object);
84      }
85  
86      public StreamMessage createStreamMessage() throws JMSException
87      {
88          return delegateSession.createStreamMessage();
89      }
90  
91      public TextMessage createTextMessage() throws JMSException
92      {
93          return delegateSession.createTextMessage();
94      }
95  
96      public TextMessage createTextMessage(String text) throws JMSException
97      {
98          return delegateSession.createTextMessage(text);
99      }
100 
101     public boolean getTransacted() throws JMSException
102     {
103         return delegateSession.getTransacted();
104     }
105 
106     public int getAcknowledgeMode() throws JMSException
107     {
108         return delegateSession.getAcknowledgeMode();
109     }
110 
111     public void commit() throws JMSException
112     {
113         delegateSession.commit();
114     }
115 
116     public void rollback() throws JMSException
117     {
118         delegateSession.rollback();
119     }
120 
121     public void close() throws JMSException
122     {
123         //Do nothing, reuse it
124     }
125 
126     public void recover() throws JMSException
127     {
128         delegateSession.recover();
129     }
130 
131     public MessageListener getMessageListener() throws JMSException
132     {
133         return delegateSession.getMessageListener();
134     }
135 
136     public void setMessageListener(MessageListener listener) throws JMSException
137     {
138         delegateSession.setMessageListener(listener);
139     }
140 
141     public void run()
142     {
143         delegateSession.run();
144     }
145 
146     public MessageProducer createProducer(Destination destination) throws JMSException
147     {
148         return delegateSession.createProducer(destination);
149     }
150 
151     public MessageConsumer createConsumer(Destination destination) throws JMSException
152     {
153         return delegateSession.createConsumer(destination);
154     }
155 
156     public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
157     {
158         return delegateSession.createConsumer(destination, messageSelector);
159     }
160 
161     public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean NoLocal) throws JMSException
162     {
163         return delegateSession.createConsumer(destination, messageSelector, NoLocal);
164     }
165 
166     public Topic createTopic(String topicName) throws JMSException
167     {
168         return delegateSession.createTopic(topicName);
169     }
170 
171     public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
172     {
173         return delegateSession.createDurableSubscriber(topic, name);
174     }
175 
176     public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
177     {
178         return delegateSession.createDurableSubscriber(topic, name, messageSelector, noLocal);
179     }
180 
181     public TemporaryTopic createTemporaryTopic() throws JMSException
182     {
183         return delegateSession.createTemporaryTopic();
184     }
185 
186     public void unsubscribe(String name) throws JMSException
187     {
188         delegateSession.unsubscribe(name);
189     }
190 }