001 /**
002 * Licensed under the Apache License, Version 2.0 (the "License");
003 * you may not use this file except in compliance with the License.
004 * You may obtain a copy of the License at
005 *
006 * http://www.apache.org/licenses/LICENSE-2.0
007 *
008 * Unless required by applicable law or agreed to in writing, software
009 * distributed under the License is distributed on an "AS IS" BASIS,
010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
011 * See the License for the specific language governing permissions and
012 * limitations under the License.
013 *
014 **/
015 package org.jencks.pool;
016
017 import javax.jms.TopicPublisher;
018 import javax.jms.Destination;
019 import javax.jms.JMSException;
020 import javax.jms.Topic;
021 import javax.jms.Message;
022
023 public class PooledTopicPublisher extends PooledProducer
024 implements TopicPublisher
025 {
026 public PooledTopicPublisher(final TopicPublisher messageProducer,
027 final Destination destination) throws JMSException
028 {
029 super(messageProducer, destination);
030 }
031
032 public Topic getTopic() throws JMSException
033 {
034 return getTopicPublisher().getTopic();
035 }
036
037 public void publish(final Message message) throws JMSException
038 {
039 getTopicPublisher().publish(message);
040 }
041
042 public void publish(final Message message, final int i, final int i1, final long l)
043 throws JMSException
044 {
045 getTopicPublisher().publish(message, i, i1, l);
046 }
047
048 public void publish(final Topic topic, final Message message) throws JMSException
049 {
050 getTopicPublisher().publish(topic, message);
051 }
052
053 public void publish(final Topic topic, final Message message, final int i, final int i1, final long l)
054 throws JMSException
055 {
056 getTopicPublisher().publish(topic, message, i, i1, l);
057 }
058
059 protected TopicPublisher getTopicPublisher()
060 {
061 return (TopicPublisher)getMessageProducer();
062 }
063 }