@Test public void testTransformDestinationFromForeignTempQueue() throws JMSException { ForeignDestination foreignDestination = new ForeignTemporaryQueue(DESTINATION_NAME); JmsDestination transformed = JmsMessageTransformation.transformDestination(createMockJmsConnection(), foreignDestination); assertNotNull(transformed); assertTrue(transformed.isQueue()); assertTrue(transformed.isTemporary()); assertEquals(DESTINATION_NAME, transformed.getAddress()); }
public static JmsDestination transformDestination(JmsConnection connection, Destination destination) throws JMSException { JmsDestination result = null; if (destination != null) { if (destination instanceof JmsDestination) { result = (JmsDestination) destination; } else if (destination instanceof Queue && destination instanceof Topic) { String queueName = ((Queue) destination).getQueueName(); String topicName = ((Topic) destination).getTopicName(); if (queueName != null && topicName == null) { result = new JmsQueue(queueName); } else if (queueName == null && topicName != null) { result = new JmsTopic(topicName); } else { result = unresolvedDestinationHandler.transform(destination); } } else { if (destination instanceof TemporaryQueue) { result = new JmsTemporaryQueue(((TemporaryQueue) destination).getQueueName()); } else if (destination instanceof TemporaryTopic) { result = new JmsTemporaryTopic(((TemporaryTopic) destination).getTopicName()); } else if (destination instanceof Queue) { result = new JmsQueue(((Queue) destination).getQueueName()); } else if (destination instanceof Topic) { result = new JmsTopic(((Topic) destination).getTopicName()); } else { result = unresolvedDestinationHandler.transform(destination); } } } return result; }
JmsMessageTransformation { public static JmsDestination transformDestination(JmsConnection connection, Destination destination) throws JMSException { JmsDestination result = null; if (destination != null) { if (destination instanceof JmsDestination) { result = (JmsDestination) destination; } else if (destination instanceof Queue && destination instanceof Topic) { String queueName = ((Queue) destination).getQueueName(); String topicName = ((Topic) destination).getTopicName(); if (queueName != null && topicName == null) { result = new JmsQueue(queueName); } else if (queueName == null && topicName != null) { result = new JmsTopic(topicName); } else { result = unresolvedDestinationHandler.transform(destination); } } else { if (destination instanceof TemporaryQueue) { result = new JmsTemporaryQueue(((TemporaryQueue) destination).getQueueName()); } else if (destination instanceof TemporaryTopic) { result = new JmsTemporaryTopic(((TemporaryTopic) destination).getTopicName()); } else if (destination instanceof Queue) { result = new JmsQueue(((Queue) destination).getQueueName()); } else if (destination instanceof Topic) { result = new JmsTopic(((Topic) destination).getTopicName()); } else { result = unresolvedDestinationHandler.transform(destination); } } } return result; } }
JmsMessageTransformation { public static JmsDestination transformDestination(JmsConnection connection, Destination destination) throws JMSException { JmsDestination result = null; if (destination != null) { if (destination instanceof JmsDestination) { result = (JmsDestination) destination; } else if (destination instanceof Queue && destination instanceof Topic) { String queueName = ((Queue) destination).getQueueName(); String topicName = ((Topic) destination).getTopicName(); if (queueName != null && topicName == null) { result = new JmsQueue(queueName); } else if (queueName == null && topicName != null) { result = new JmsTopic(topicName); } else { result = unresolvedDestinationHandler.transform(destination); } } else { if (destination instanceof TemporaryQueue) { result = new JmsTemporaryQueue(((TemporaryQueue) destination).getQueueName()); } else if (destination instanceof TemporaryTopic) { result = new JmsTemporaryTopic(((TemporaryTopic) destination).getTopicName()); } else if (destination instanceof Queue) { result = new JmsQueue(((Queue) destination).getQueueName()); } else if (destination instanceof Topic) { result = new JmsTopic(((Topic) destination).getTopicName()); } else { result = unresolvedDestinationHandler.transform(destination); } } } return result; }  }
JmsMessageTransformation { public static JmsDestination transformDestination(JmsConnection connection, Destination destination) throws JMSException { JmsDestination result = null; if (destination != null) { if (destination instanceof JmsDestination) { result = (JmsDestination) destination; } else if (destination instanceof Queue && destination instanceof Topic) { String queueName = ((Queue) destination).getQueueName(); String topicName = ((Topic) destination).getTopicName(); if (queueName != null && topicName == null) { result = new JmsQueue(queueName); } else if (queueName == null && topicName != null) { result = new JmsTopic(topicName); } else { result = unresolvedDestinationHandler.transform(destination); } } else { if (destination instanceof TemporaryQueue) { result = new JmsTemporaryQueue(((TemporaryQueue) destination).getQueueName()); } else if (destination instanceof TemporaryTopic) { result = new JmsTemporaryTopic(((TemporaryTopic) destination).getTopicName()); } else if (destination instanceof Queue) { result = new JmsQueue(((Queue) destination).getQueueName()); } else if (destination instanceof Topic) { result = new JmsTopic(((Topic) destination).getTopicName()); } else { result = unresolvedDestinationHandler.transform(destination); } } } return result; }  static JmsDestination transformDestination(JmsConnection connection, Destination destination); static JmsMessage transformMessage(JmsConnection connection, Message message); static void copyProperties(JmsConnection connection, Message source, JmsMessage target); static void setUnresolvedDestinationHandler(JmsUnresolvedDestinationTransformer handler); static JmsUnresolvedDestinationTransformer getUnresolvedDestinationTransformer(); }
JmsMessageTransformation { public static JmsDestination transformDestination(JmsConnection connection, Destination destination) throws JMSException { JmsDestination result = null; if (destination != null) { if (destination instanceof JmsDestination) { result = (JmsDestination) destination; } else if (destination instanceof Queue && destination instanceof Topic) { String queueName = ((Queue) destination).getQueueName(); String topicName = ((Topic) destination).getTopicName(); if (queueName != null && topicName == null) { result = new JmsQueue(queueName); } else if (queueName == null && topicName != null) { result = new JmsTopic(topicName); } else { result = unresolvedDestinationHandler.transform(destination); } } else { if (destination instanceof TemporaryQueue) { result = new JmsTemporaryQueue(((TemporaryQueue) destination).getQueueName()); } else if (destination instanceof TemporaryTopic) { result = new JmsTemporaryTopic(((TemporaryTopic) destination).getTopicName()); } else if (destination instanceof Queue) { result = new JmsQueue(((Queue) destination).getQueueName()); } else if (destination instanceof Topic) { result = new JmsTopic(((Topic) destination).getTopicName()); } else { result = unresolvedDestinationHandler.transform(destination); } } } return result; }  static JmsDestination transformDestination(JmsConnection connection, Destination destination); static JmsMessage transformMessage(JmsConnection connection, Message message); static void copyProperties(JmsConnection connection, Message source, JmsMessage target); static void setUnresolvedDestinationHandler(JmsUnresolvedDestinationTransformer handler); static JmsUnresolvedDestinationTransformer getUnresolvedDestinationTransformer();  }