Example usage for javax.jms MessageConsumer getClass

List of usage examples for javax.jms MessageConsumer getClass

Introduction

In this page you can find the example usage for javax.jms MessageConsumer getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

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();
    }/*w w  w .  j a v a2 s  .  c om*/
    if (messageConsumer instanceof TopicSubscriber) {
        TopicSubscriber topicSubscriber = (TopicSubscriber) messageConsumer;
        return topicSubscriber.getTopic();
    }
    throw new JMSException("unknown message consumer type: " + messageConsumer.getClass());
}