package org.mockejb.jms;
import javax.jms.*;
class QueueSenderImpl extends MockProducer implements QueueSender {
QueueSenderImpl(MockQueue queue) {
super(queue);
}
public Queue getQueue() throws JMSException {
return (Queue) getDestination();
}
public void send(Queue queue, Message msg) throws JMSException {
send(queue, msg, getDeliveryMode(), getPriority(), 0);
}
public void send(
Queue queue,
Message msg,
int deliveryMode,
int priority,
long timeToLive)
throws JMSException {
checkDestination(true);
if (queue instanceof MockQueue) {
MockProducer.sendMessage(
(MockQueue) queue,
msg,
deliveryMode,
priority,
timeToLive);
}
throw new InvalidDestinationException("Invalid queue specified!");
}
}