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.QueueSender;
18  import javax.jms.Destination;
19  import javax.jms.JMSException;
20  import javax.jms.Queue;
21  import javax.jms.Message;
22  
23  /***
24   * @version $Revision$
25   */
26  public class PooledQueueSender extends PooledProducer implements QueueSender
27  {
28    public PooledQueueSender(final QueueSender messageProducer,
29                             final Destination destination) throws JMSException
30    {
31      super(messageProducer, destination);
32    }
33  
34    public void send(final Queue queue, final Message message, final int i, final int i1, final long l)
35        throws JMSException
36    {
37      getQueueSender().send(queue, message, i, i1, l);
38    }
39  
40    public void send(Queue queue, Message message) throws JMSException
41    {
42      getQueueSender().send(queue, message);
43    }
44  
45    public Queue getQueue() throws JMSException
46    {
47      return getQueueSender().getQueue();
48    }
49  
50  
51    protected QueueSender getQueueSender()
52    {
53      return (QueueSender)getMessageProducer();
54    }
55  
56  }