public static ActiveMQTopic createTopic(final String address) { return new ActiveMQTopic(address); }
public static ActiveMQTopic createTopic(final String address, final String name) { return new ActiveMQTopic(address, name); }
public static ActiveMQTopic createTopic(final SimpleString address) { return new ActiveMQTopic(address); }
/** * Static helper method for working with destinations. */ public static ActiveMQDestination createDestination(String name, TYPE defaultType) { if (name.startsWith(QUEUE_QUALIFIED_PREFIX)) { return new ActiveMQQueue(name.substring(QUEUE_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) { return new ActiveMQTopic(name.substring(TOPIC_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) { return new ActiveMQQueue(name.substring(TEMP_QUEUE_QUALIFED_PREFIX.length()), true); } else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) { return new ActiveMQTopic(name.substring(TEMP_TOPIC_QUALIFED_PREFIX.length()), true); } switch (defaultType) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQQueue(name, true); case TEMP_TOPIC: return new ActiveMQTopic(name, true); case DESTINATION: return new ActiveMQDestination(name, TYPE.DESTINATION, null); default: throw new IllegalArgumentException("Invalid default destination type: " + defaultType); } }
@Override public Destination getDestination( JmsDelegate delegate ) { checkNotNull( delegate.destinationName, getString( PKG, "JmsWebsphereMQ.DestinationNameRequired" ) ); String destName = delegate.destinationName; return isQueue( delegate ) ? new ActiveMQQueue( destName ) : new ActiveMQTopic( destName ); } }
@Override public MessageConsumer createSharedDurableConsumer(Topic topic, String name, String messageSelector) throws JMSException { if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION) { throw new IllegalStateException("Cannot create a shared durable consumer on a QueueSession"); } checkTopic(topic); ActiveMQTopic localTopic; if (topic instanceof ActiveMQTopic) { localTopic = (ActiveMQTopic) topic; } else { localTopic = new ActiveMQTopic(topic.getTopicName()); } return internalCreateSharedConsumer(localTopic, name, messageSelector, ConsumerDurability.DURABLE); }
@Override public MessageConsumer createDurableConsumer(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException { if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION) { throw new IllegalStateException("Cannot create a durable consumer on a QueueSession"); } checkTopic(topic); ActiveMQTopic localTopic; if (topic instanceof ActiveMQTopic) { localTopic = (ActiveMQTopic) topic; } else { localTopic = new ActiveMQTopic(topic.getTopicName()); } return createConsumer(localTopic, name, messageSelector, noLocal, ConsumerDurability.DURABLE); }
/** * Note: Needs to throw an exception if a subscriptionName is already in use by another topic, or if the messageSelector is different * * validate multiple subscriptions on the same session. * validate multiple subscriptions on different sessions * validate failure in one connection while another connection stills fine. * Validate different filters in different possible scenarios * * @param topic * @param name * @param messageSelector * @return * @throws JMSException */ @Override public MessageConsumer createSharedConsumer(Topic topic, String name, String messageSelector) throws JMSException { if (sessionType == ActiveMQSession.TYPE_QUEUE_SESSION) { throw new IllegalStateException("Cannot create a shared consumer on a QueueSession"); } checkTopic(topic); ActiveMQTopic localTopic; if (topic instanceof ActiveMQTopic) { localTopic = (ActiveMQTopic) topic; } else { localTopic = new ActiveMQTopic(topic.getTopicName()); } return internalCreateSharedConsumer(localTopic, name, messageSelector, ConsumerDurability.NON_DURABLE); }
public static ActiveMQTopic createTopic(final String address) { return new ActiveMQTopic(address); }
public static ActiveMQTopic createTopic(final SimpleString address) { return new ActiveMQTopic(address); }
public static ActiveMQTopic createTopic(final String address, final String name) { return new ActiveMQTopic(address, name); }
public static ActiveMQTopic createTopic(final String address) { return new ActiveMQTopic(address); }
public static ActiveMQTopic createTopic(final SimpleString address) { return new ActiveMQTopic(address); }
public static ActiveMQTopic createTopic(final String address, final String name) { return new ActiveMQTopic(address, name); }
public static ActiveMQTopic createTopic(final String address, final String name) { return new ActiveMQTopic(address, name); }
public static ActiveMQTopic createTopic(final String address, final String name) { return new ActiveMQTopic(address, name); }
public static ActiveMQTopic createTopic(final SimpleString address) { return new ActiveMQTopic(address); }
public static ActiveMQTopic createTopic(final String address) { return new ActiveMQTopic(address); }
@Override public void run() { try { // add back the jms.topic. prefix to be consistent with ActiveMQ Artemis 1.x addressing scheme jmsManager.createTopic(JMS_TOPIC_PREFIX + name, false, name); topic = new ActiveMQTopic(JMS_TOPIC_PREFIX + name, name); context.complete(); } catch (Throwable e) { context.failed(MessagingLogger.ROOT_LOGGER.failedToCreate(e, "JMS Topic")); } } };
@Override public void run() { try { // add back the jms.topic. prefix to be consistent with ActiveMQ Artemis 1.x addressing scheme jmsManager.createTopic(JMS_TOPIC_PREFIX + name, false, name); topic = new ActiveMQTopic(JMS_TOPIC_PREFIX + name, name); context.complete(); } catch (Throwable e) { context.failed(MessagingLogger.ROOT_LOGGER.failedToCreate(e, "JMS Topic")); } } };