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 ReusableTopicSessionWrapper implements TopicSession
16  {
17      protected transient Log logger = LogFactory.getLog(getClass());
18  
19      private TopicSession delegateSession;
20  
21      ReusableTopicSessionWrapper(TopicSession delegateSession)
22      {
23          this.delegateSession = delegateSession;
24      }
25  
26      public Topic createTopic(String topicName) throws JMSException
27      {
28          return delegateSession.createTopic(topicName);
29      }
30  
31      public TopicSubscriber createSubscriber(Topic topic) throws JMSException
32      {
33          return delegateSession.createSubscriber(topic);
34      }
35  
36      public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
37      {
38          return delegateSession.createSubscriber(topic, messageSelector, noLocal);
39      }
40  
41      public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
42      {
43          return delegateSession.createDurableSubscriber(topic, name);
44      }
45  
46      public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
47      {
48          return delegateSession.createDurableSubscriber(topic, name, messageSelector, noLocal);
49      }
50  
51      public TopicPublisher createPublisher(Topic topic) throws JMSException
52      {
53          return delegateSession.createPublisher(topic);
54      }
55  
56      public TemporaryTopic createTemporaryTopic() throws JMSException
57      {
58          return delegateSession.createTemporaryTopic();
59      }
60  
61      public void unsubscribe(String name) throws JMSException
62      {
63          delegateSession.unsubscribe(name);
64      }
65  
66      public BytesMessage createBytesMessage() throws JMSException
67      {
68          return delegateSession.createBytesMessage();
69      }
70  
71      public MapMessage createMapMessage() throws JMSException
72      {
73          return delegateSession.createMapMessage();
74      }
75  
76      public Message createMessage() throws JMSException
77      {
78          return delegateSession.createMessage();
79      }
80  
81      public ObjectMessage createObjectMessage() throws JMSException
82      {
83          return delegateSession.createObjectMessage();
84      }
85  
86      public ObjectMessage createObjectMessage(Serializable object) throws JMSException
87      {
88          return delegateSession.createObjectMessage(object);
89      }
90  
91      public StreamMessage createStreamMessage() throws JMSException
92      {
93          return delegateSession.createStreamMessage();
94      }
95  
96      public TextMessage createTextMessage() throws JMSException
97      {
98          return delegateSession.createTextMessage();
99      }
100 
101     public TextMessage createTextMessage(String text) throws JMSException
102     {
103         return delegateSession.createTextMessage(text);
104     }
105 
106     public boolean getTransacted() throws JMSException
107     {
108         return delegateSession.getTransacted();
109     }
110 
111     public int getAcknowledgeMode() throws JMSException
112     {
113         return delegateSession.getAcknowledgeMode();
114     }
115 
116     public void commit() throws JMSException
117     {
118         delegateSession.commit();
119     }
120 
121     public void rollback() throws JMSException
122     {
123         delegateSession.rollback();
124     }
125 
126     public void close() throws JMSException
127     {
128         //Do nothing, reuse it
129     }
130 
131     public void recover() throws JMSException
132     {
133         delegateSession.recover();
134     }
135 
136     public MessageListener getMessageListener() throws JMSException
137     {
138         return delegateSession.getMessageListener();
139     }
140 
141     public void setMessageListener(MessageListener listener) throws JMSException
142     {
143         delegateSession.setMessageListener(listener);
144     }
145 
146     public void run()
147     {
148         delegateSession.run();
149     }
150 
151     public MessageProducer createProducer(Destination destination) throws JMSException
152     {
153         return delegateSession.createProducer(destination);
154     }
155 
156     public MessageConsumer createConsumer(Destination destination) throws JMSException
157     {
158         return delegateSession.createConsumer(destination);
159     }
160 
161     public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
162     {
163         return delegateSession.createConsumer(destination, messageSelector);
164     }
165 
166     public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean NoLocal) throws JMSException
167     {
168         return delegateSession.createConsumer(destination, messageSelector, NoLocal);
169     }
170 
171     public Queue createQueue(String queueName) throws JMSException
172     {
173         return delegateSession.createQueue(queueName);
174     }
175 
176     public QueueBrowser createBrowser(Queue queue) throws JMSException
177     {
178         return delegateSession.createBrowser(queue);
179     }
180 
181     public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
182     {
183         return delegateSession.createBrowser(queue, messageSelector);
184     }
185 
186     public TemporaryQueue createTemporaryQueue() throws JMSException
187     {
188         return delegateSession.createTemporaryQueue();
189     }
190 }