package org.mockejb.jms;
import javax.jms.*;
import org.mockejb.MethodNotImplementedException;
class TopicConnectionImpl extends MockConnection implements TopicConnection {
TopicConnectionImpl(int clientId) {
super("TopicClient:" + clientId);
}
public TopicSession createTopicSession(
boolean transacted,
int acknowledgeMode)
throws JMSException {
return (TopicSession)createSession(transacted, acknowledgeMode);
}
public ConnectionConsumer createConnectionConsumer(
Topic topic,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
throws JMSException {
throw new MethodNotImplementedException(
"createConnectionConsumer",
"TopicConnectionImpl");
}
public ConnectionConsumer createDurableConnectionConsumer(
Topic topic,
String subscriptionName,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
throws JMSException {
throw new javax.jms.IllegalStateException(
"Queue connection can not create durable connection consumer!");
}
MockSession createMockSession(boolean transacted, int acknowledgeMode) {
return new TopicSessionImpl(transacted, acknowledgeMode, this);
}
}