All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mockrunner.mock.jms.MockTopicSession Maven / Gradle / Ivy

There is a newer version: 2.0.7
Show newest version
package com.mockrunner.mock.jms;

import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;

/**
 * Mock implementation of JMS TopicSession.
 */
public class MockTopicSession extends MockSession implements TopicSession
{
    public MockTopicSession(MockTopicConnection connection)
    {
        this(connection, false, Session.AUTO_ACKNOWLEDGE);
    }
    
    public MockTopicSession(MockTopicConnection connection, boolean transacted, int acknowledgeMode)
    {
        super(connection, transacted, acknowledgeMode);
    }

    public TopicPublisher createPublisher(Topic topic) throws JMSException
    {
        return (TopicPublisher)createProducer(topic);
    }

    public TopicSubscriber createSubscriber(Topic topic) throws JMSException
    {
        return (TopicSubscriber)createConsumer(topic);
    }

    public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
    {
        return (TopicSubscriber)createConsumer(topic, messageSelector, noLocal);
    }
    
    protected MessageProducer createProducerForNullDestination()
    {
        return getGenericTransmissionManager().createTopicPublisher();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy