1 18 package org.apache.activemq.systest.impl; 19 20 import org.apache.activemq.command.ActiveMQQueue; 21 import org.apache.activemq.command.ActiveMQTempQueue; 22 import org.apache.activemq.command.ActiveMQTempTopic; 23 import org.apache.activemq.command.ActiveMQTopic; 24 import org.apache.activemq.systest.DestinationFactory; 25 26 import javax.jms.Destination ; 27 import javax.jms.JMSException ; 28 29 33 public class DestinationFactoryImpl implements DestinationFactory { 34 35 public Destination createDestination(String physicalName, int destinationType) throws JMSException { 36 switch (destinationType) { 37 38 case TOPIC: 39 return new ActiveMQTopic(physicalName); 40 41 case QUEUE: 42 return new ActiveMQQueue(physicalName); 43 44 case TEMPORARY_QUEUE: 45 return new ActiveMQTempQueue(physicalName); 46 47 case TEMPORARY_TOPIC: 48 return new ActiveMQTempTopic(physicalName); 49 50 default: 51 throw new JMSException ("Invalid destinationType: " + destinationType); 52 } 53 } 54 55 } 56 | Popular Tags |