Example usage for javax.jms TopicSubscriber getTopic

List of usage examples for javax.jms TopicSubscriber getTopic

Introduction

In this page you can find the example usage for javax.jms TopicSubscriber getTopic.

Prototype


Topic getTopic() throws JMSException;

Source Link

Document

Gets the Topic associated with this subscriber.

Usage

From source file:org.jbpm.bpel.integration.jms.StartListener.java

private static Destination getDestination(MessageConsumer messageConsumer) throws JMSException {
    if (messageConsumer instanceof QueueReceiver) {
        QueueReceiver queueReceiver = (QueueReceiver) messageConsumer;
        return queueReceiver.getQueue();
    }//from   w  w  w  . j  a  v a 2 s  .  c  o m
    if (messageConsumer instanceof TopicSubscriber) {
        TopicSubscriber topicSubscriber = (TopicSubscriber) messageConsumer;
        return topicSubscriber.getTopic();
    }
    throw new JMSException("unknown message consumer type: " + messageConsumer.getClass());
}