public static ActiveMQTopic createTopic(final String address) { return new ActiveMQTopic(address); }
@Override public int hashCode() { return super.getAddress().hashCode(); }
@Override public String toString() { return "ActiveMQTopic[" + getName() + "]"; }
private ActiveMQTopic lookupTopic(final String topicName, final boolean isTemporary) throws ActiveMQException { String topicNameToUse = topicName; if (enable1xPrefixes) { topicNameToUse = (isTemporary ? PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString() : PacketImpl.OLD_TOPIC_PREFIX.toString()) + topicName; } ActiveMQTopic topic; if (isTemporary) { topic = ActiveMQDestination.createTemporaryTopic(topicNameToUse); } else { topic = ActiveMQDestination.createTopic(topicNameToUse); } AddressQuery query = session.addressQuery(topic.getSimpleAddress()); if (!query.isExists() && !query.isAutoCreateAddresses()) { return null; } else { return topic; } }
@Override public boolean addTopicToBindingRegistry(final String topicName, final String registryBinding) throws Exception { checkInitialised(); checkBindings(registryBinding); ActiveMQTopic destination = topics.get(topicName); if (destination == null) { throw new IllegalArgumentException("Topic does not exist"); } if (destination.getTopicName() == null) { throw new IllegalArgumentException(topicName + " is not a topic"); } boolean added = bindToBindings(registryBinding, destination); if (added) { addToBindings(topicBindings, topicName, registryBinding); storage.addBindings(PersistedType.Topic, topicName, registryBinding); } return added; }
private ActiveMQTopic lookupTopic(final String topicName, final boolean isTemporary) throws ActiveMQException { String topicNameToUse = topicName; if (enable1xPrefixes) { topicNameToUse = (isTemporary ? PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString() : PacketImpl.OLD_TOPIC_PREFIX.toString()) + topicName; } ActiveMQTopic topic; if (isTemporary) { topic = ActiveMQDestination.createTemporaryTopic(topicNameToUse); } else { topic = ActiveMQDestination.createTopic(topicNameToUse); } AddressQuery query = session.addressQuery(topic.getSimpleAddress()); if (!query.isExists() && !query.isAutoCreateAddresses()) { return null; } else { return topic; } }
@Test public void testReferenceTopic() throws Exception { Reference topicRef = ((Referenceable) ActiveMQServerTestCase.topic1).getReference(); String factoryName = topicRef.getFactoryClassName(); Class factoryClass = Class.forName(factoryName); ObjectFactory factory = (ObjectFactory) factoryClass.newInstance(); Object instance = factory.getObjectInstance(topicRef, null, null, null); ProxyAssertSupport.assertTrue(instance instanceof ActiveMQDestination); ActiveMQTopic topic2 = (ActiveMQTopic) instance; ProxyAssertSupport.assertEquals(ActiveMQServerTestCase.topic1.getTopicName(), topic2.getTopicName()); simpleSendReceive(cf, topic2); }
public static ActiveMQTopic createTopic(final SimpleString address) { return new ActiveMQTopic(address); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ActiveMQTopic)) { return false; } ActiveMQTopic that = (ActiveMQTopic) o; return super.getAddress().equals(that.getAddress()); }
@Override public String getTopicName() { return getName(); }
private ActiveMQTopic lookupTopic(final String topicName, final boolean isTemporary) throws ActiveMQException { String topicNameToUse = topicName; if (enable1xPrefixes) { topicNameToUse = (isTemporary ? PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString() : PacketImpl.OLD_TOPIC_PREFIX.toString()) + topicName; } ActiveMQTopic topic; if (isTemporary) { topic = ActiveMQDestination.createTemporaryTopic(topicNameToUse); } else { topic = ActiveMQDestination.createTopic(topicNameToUse); } AddressQuery query = session.addressQuery(topic.getSimpleAddress()); if (!query.isExists() && !query.isAutoCreateAddresses()) { return null; } else { return topic; } }
public static ActiveMQTopic createTopic(final String address, final String name) { return new ActiveMQTopic(address, name); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ActiveMQTemporaryTopic)) { return false; } ActiveMQTemporaryTopic that = (ActiveMQTemporaryTopic) o; return super.getAddress().equals(that.getAddress()); }
@Override public String toString() { return "ActiveMQTopic[" + getName() + "]"; }
private ActiveMQTopic lookupTopic(final String topicName, final boolean isTemporary) throws ActiveMQException { String topicNameToUse = topicName; if (enable1xPrefixes) { topicNameToUse = (isTemporary ? PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString() : PacketImpl.OLD_TOPIC_PREFIX.toString()) + topicName; } ActiveMQTopic topic; if (isTemporary) { topic = ActiveMQDestination.createTemporaryTopic(topicNameToUse); } else { topic = ActiveMQDestination.createTopic(topicNameToUse); } AddressQuery query = session.addressQuery(topic.getSimpleAddress()); if (!query.isExists() && !query.isAutoCreateAddresses()) { return null; } else { return topic; } }
/** * 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 int hashCode() { return super.getAddress().hashCode(); }
@Override public String getTopicName() { return getName(); }
private ActiveMQTopic lookupTopic(final String topicName, final boolean isTemporary) throws ActiveMQException { String topicNameToUse = topicName; if (enable1xPrefixes) { topicNameToUse = (isTemporary ? PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString() : PacketImpl.OLD_TOPIC_PREFIX.toString()) + topicName; } ActiveMQTopic topic; if (isTemporary) { topic = ActiveMQDestination.createTemporaryTopic(topicNameToUse); } else { topic = ActiveMQDestination.createTopic(topicNameToUse); } AddressQuery query = session.addressQuery(topic.getSimpleAddress()); if (!query.isExists() && !query.isAutoCreateAddresses()) { return null; } else { return topic; } }
@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 ); } }