package org.mockejb.jms;
import javax.jms.*;
import org.mockejb.MethodNotImplementedException;
class TopicSessionImpl extends MockSession implements TopicSession {
TopicSessionImpl(boolean transacted, int acknowledgeMode, MockConnection connection) {
super(transacted, acknowledgeMode, connection);
}
public Topic createTopic(String topicName) throws JMSException {
throw new MethodNotImplementedException(
"createTopic",
"TopicSessionImpl");
}
public TopicSubscriber createSubscriber(Topic topic) throws JMSException {
return (TopicSubscriber)createConsumer(topic);
}
public TopicSubscriber createSubscriber(
Topic topic,
String messageSelector,
boolean noLocal)
throws JMSException {
throw new MethodNotImplementedException(
"createSubscriber",
"TopicSessionImpl");
}
public TopicSubscriber createDurableSubscriber(Topic topic, String name)
throws JMSException {
throw new MethodNotImplementedException(
"createDurableSubscriber",
"TopicSessionImpl");
}
public TopicSubscriber createDurableSubscriber(
Topic topic,
String name,
String messageSelector,
boolean noLocal)
throws JMSException {
throw new MethodNotImplementedException(
"createDurableSubscriber",
"TopicSessionImpl");
}
public TopicPublisher createPublisher(Topic topic) throws JMSException {
checkClosed();
return (TopicPublisher)createProducer(topic);
}
public TemporaryTopic createTemporaryTopic() throws JMSException {
throw new MethodNotImplementedException(
"createTemporaryTopic",
"TopicSessionImpl");
}
public void unsubscribe(String name) throws JMSException {
throw new MethodNotImplementedException(
"unsubscribe",
"TopicSessionImpl");
}
public Queue createQueue(String queueName) throws JMSException {
throw new javax.jms.IllegalStateException(
"Topic session can not create queue!");
}
public QueueBrowser createBrowser(Queue queue) throws JMSException {
throw new javax.jms.IllegalStateException(
"Topic session can not create queue browser!");
}
public QueueBrowser createBrowser(Queue queue, String messageSelector)
throws JMSException {
throw new javax.jms.IllegalStateException(
"Topic session can not create queue browser!");
}
public TemporaryQueue createTemporaryQueue() throws JMSException {
throw new javax.jms.IllegalStateException(
"Topic session can not create temporary queue!");
}
MockConsumer createMockConsumer(MockDestination destination) throws JMSException {
if (destination instanceof MockTopic) {
return new TopicSubscriberImpl(this, (MockTopic) destination);
}
throw new InvalidDestinationException("Invalid topic specified!");
}
MockProducer createMockProducer(MockDestination destination) throws JMSException {
if (destination instanceof MockTopic) {
return new TopicPublisherImpl((MockTopic) destination);
}
throw new InvalidDestinationException("Invalid topic specified!");
}
}