View Javadoc

1   /*** 
2    * Licensed under the Apache License, Version 2.0 (the "License"); 
3    * you may not use this file except in compliance with the License. 
4    * You may obtain a copy of the License at 
5    * 
6    * http://www.apache.org/licenses/LICENSE-2.0
7    * 
8    * Unless required by applicable law or agreed to in writing, software
9    * distributed under the License is distributed on an "AS IS" BASIS, 
10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
11   * See the License for the specific language governing permissions and 
12   * limitations under the License. 
13   * 
14   **/
15  package org.jencks.pool;
16  
17  import javax.jms.TopicPublisher;
18  import javax.jms.Destination;
19  import javax.jms.JMSException;
20  import javax.jms.Topic;
21  import javax.jms.Message;
22  
23  public class PooledTopicPublisher extends PooledProducer
24      implements TopicPublisher
25  {
26    public PooledTopicPublisher(final TopicPublisher messageProducer,
27                                final Destination destination) throws JMSException
28    {
29      super(messageProducer, destination);
30    }
31  
32    public Topic getTopic() throws JMSException
33    {
34      return getTopicPublisher().getTopic();
35    }
36  
37    public void publish(final Message message) throws JMSException
38    {
39      getTopicPublisher().publish(message);
40    }
41  
42    public void publish(final Message message, final int i, final int i1, final long l)
43        throws JMSException
44    {
45      getTopicPublisher().publish(message, i, i1, l);
46    }
47  
48    public void publish(final Topic topic, final Message message) throws JMSException
49    {
50      getTopicPublisher().publish(topic, message);
51    }
52  
53    public void publish(final Topic topic, final Message message, final int i, final int i1, final long l)
54        throws JMSException
55    {
56      getTopicPublisher().publish(topic, message, i, i1, l);
57    }
58  
59    protected TopicPublisher getTopicPublisher()
60    {
61      return (TopicPublisher)getMessageProducer();
62    }
63  }