本文整理汇总了Java中org.apache.activemq.command.ActiveMQDestination.isTopic方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQDestination.isTopic方法的具体用法?Java ActiveMQDestination.isTopic怎么用?Java ActiveMQDestination.isTopic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.command.ActiveMQDestination
的用法示例。
在下文中一共展示了ActiveMQDestination.isTopic方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureBridge
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
protected NetworkBridge configureBridge(DemandForwardingBridgeSupport result) {
List<ActiveMQDestination> destsList = getDynamicallyIncludedDestinations();
ActiveMQDestination dests[] = destsList.toArray(new ActiveMQDestination[destsList.size()]);
result.setDynamicallyIncludedDestinations(dests);
destsList = getExcludedDestinations();
dests = destsList.toArray(new ActiveMQDestination[destsList.size()]);
result.setExcludedDestinations(dests);
destsList = getStaticallyIncludedDestinations();
dests = destsList.toArray(new ActiveMQDestination[destsList.size()]);
result.setStaticallyIncludedDestinations(dests);
if (durableDestinations != null) {
HashSet<ActiveMQDestination> topics = new HashSet<ActiveMQDestination>();
for (ActiveMQDestination d : durableDestinations) {
if( d.isTopic() ) {
topics.add(d);
}
}
ActiveMQDestination[] dest = new ActiveMQDestination[topics.size()];
dest = topics.toArray(dest);
result.setDurableDestinations(dest);
}
return result;
}
示例2: setupStaticDestinations
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
* Subscriptions for these destinations are always created
*
*/
protected void setupStaticDestinations() {
super.setupStaticDestinations();
ActiveMQDestination[] dests = configuration.isDynamicOnly() ? null : durableDestinations;
if (dests != null) {
for (ActiveMQDestination dest : dests) {
if (isPermissableDestination(dest) && !doesConsumerExist(dest)) {
DemandSubscription sub = createDemandSubscription(dest);
sub.setStaticallyIncluded(true);
if (dest.isTopic()) {
sub.getLocalInfo().setSubscriptionName(getSubscriberName(dest));
}
try {
addSubscription(sub);
} catch (IOException e) {
LOG.error("Failed to add static destination {}", dest, e);
}
LOG.trace("Forwarding messages for durable destination: {}", dest);
}
}
}
}
示例3: isAdvisoryTopic
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isAdvisoryTopic(ActiveMQDestination destination) {
if (destination != null) {
if (destination.isComposite()) {
ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
for (int i = 0; i < compositeDestinations.length; i++) {
if (isAdvisoryTopic(compositeDestinations[i])) {
return true;
}
}
return false;
} else {
return destination.isTopic() && destination.getPhysicalName().startsWith(ADVISORY_TOPIC_PREFIX);
}
}
return false;
}
示例4: buildExistingSubscriptions
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
protected void buildExistingSubscriptions() throws Exception {
Map<SubscriptionKey, SubscriptionInfo> subscriptions = new HashMap<SubscriptionKey, SubscriptionInfo>();
Set<ActiveMQDestination> destinations = destinationFactory.getDestinations();
if (destinations != null) {
for (ActiveMQDestination dest : destinations) {
if (dest.isTopic()) {
SubscriptionInfo[] infos = destinationFactory.getAllDurableSubscriptions((ActiveMQTopic)dest);
if (infos != null) {
for (int i = 0; i < infos.length; i++) {
SubscriptionInfo info = infos[i];
SubscriptionKey key = new SubscriptionKey(info);
if (!alreadyKnown(key)) {
LOG.debug("Restoring durable subscription MBean {}", info);
subscriptions.put(key, info);
}
}
}
}
}
}
for (Map.Entry<SubscriptionKey, SubscriptionInfo> entry : subscriptions.entrySet()) {
addInactiveSubscription(entry.getKey(), entry.getValue(), null);
}
}
示例5: doMultipleClientsTest
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public void doMultipleClientsTest() throws Exception {
// Create destination
final ActiveMQDestination dest = createDestination();
// Create consumers
ActiveMQConnectionFactory consumerFactory = (ActiveMQConnectionFactory) createConnectionFactory();
consumerFactory.getPrefetchPolicy().setAll(prefetchCount);
startConsumers(consumerFactory, dest);
startProducers(dest, messageCount);
// Wait for messages to be received. Make it proportional to the
// messages delivered.
int totalMessageCount = messageCount * producerCount;
if (dest.isTopic()) {
totalMessageCount *= consumerCount;
}
waitForAllMessagesToBeReceived(totalMessageCount);
}
示例6: getAMQueueMessageCount
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public long getAMQueueMessageCount(ActiveMQDestination amq5Dest) {
if (amq5Dest.isTopic()) {
throw new IllegalArgumentException("Method only accept queue type parameter.");
}
long count = 0;
String qname = null;
if (amq5Dest.isTemporary()) {
qname = amq5Dest.getPhysicalName();
} else {
qname = amq5Dest.getPhysicalName();
}
Binding binding = server.getPostOffice().getBinding(new SimpleString(qname));
if (binding != null) {
QueueImpl q = (QueueImpl) binding.getBindable();
count = q.getMessageCount();
}
return count;
}
示例7: sendToDeadLetterQueue
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
@Override
public boolean sendToDeadLetterQueue(ConnectionContext ctx, MessageReference msgRef, Subscription subscription, Throwable poisonCause) {
log.trace("Discarding DLQ BrokerFilter[pass through] - skipping message: {}", (msgRef != null ? msgRef.getMessage() : null));
boolean dropped = true;
Message msg = null;
ActiveMQDestination dest = null;
String destName = null;
msg = msgRef.getMessage();
dest = msg.getDestination();
destName = dest.getPhysicalName();
if (dest == null || destName == null) {
// do nothing, no need to forward it
skipMessage("NULL DESTINATION", msgRef);
} else if (dropAll) {
// do nothing
skipMessage("dropAll", msgRef);
} else if (dropTemporaryTopics && dest.isTemporary() && dest.isTopic()) {
// do nothing
skipMessage("dropTemporaryTopics", msgRef);
} else if (dropTemporaryQueues && dest.isTemporary() && dest.isQueue()) {
// do nothing
skipMessage("dropTemporaryQueues", msgRef);
} else if (destFilter != null && matches(destName)) {
// do nothing
skipMessage("dropOnly", msgRef);
} else {
dropped = false;
return next.sendToDeadLetterQueue(ctx, msgRef, subscription, poisonCause);
}
if (dropped && getReportInterval() > 0) {
if ((++dropCount) % getReportInterval() == 0) {
log.info("Total of {} messages were discarded, since their destination was the dead letter queue", dropCount);
}
}
return false;
}
示例8: isProducerAdvisoryTopic
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isProducerAdvisoryTopic(ActiveMQDestination destination) {
if (destination.isComposite()) {
ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
for (int i = 0; i < compositeDestinations.length; i++) {
if (isProducerAdvisoryTopic(compositeDestinations[i])) {
return true;
}
}
return false;
} else {
return destination.isTopic() && destination.getPhysicalName().startsWith(PRODUCER_ADVISORY_TOPIC_PREFIX);
}
}
示例9: isConsumerAdvisoryTopic
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isConsumerAdvisoryTopic(ActiveMQDestination destination) {
if (destination.isComposite()) {
ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
for (int i = 0; i < compositeDestinations.length; i++) {
if (isConsumerAdvisoryTopic(compositeDestinations[i])) {
return true;
}
}
return false;
} else {
return destination.isTopic() && destination.getPhysicalName().startsWith(CONSUMER_ADVISORY_TOPIC_PREFIX);
}
}
示例10: isSlowConsumerAdvisoryTopic
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isSlowConsumerAdvisoryTopic(ActiveMQDestination destination) {
if (destination.isComposite()) {
ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
for (int i = 0; i < compositeDestinations.length; i++) {
if (isSlowConsumerAdvisoryTopic(compositeDestinations[i])) {
return true;
}
}
return false;
} else {
return destination.isTopic() && destination.getPhysicalName().startsWith(SLOW_CONSUMER_TOPIC_PREFIX);
}
}
示例11: addDestination
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public void addDestination(DestinationInfo info) throws Exception {
boolean created = false;
ActiveMQDestination dest = info.getDestination();
if (!protocolManager.isSupportAdvisory() && AdvisorySupport.isAdvisoryTopic(dest)) {
return;
}
SimpleString qName = SimpleString.toSimpleString(dest.getPhysicalName());
if (server.locateQueue(qName) == null) {
AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(dest.getPhysicalName());
AddressInfo addressInfo = new AddressInfo(qName, dest.isTopic() ? RoutingType.MULTICAST : RoutingType.ANYCAST);
if (AdvisorySupport.isAdvisoryTopic(dest) && protocolManager.isSuppressInternalManagementObjects()) {
addressInfo.setInternal(true);
}
if (dest.isQueue() && (addressSettings.isAutoCreateQueues() || dest.isTemporary())) {
internalSession.createQueue(addressInfo, qName, null, dest.isTemporary(), !dest.isTemporary(), !dest.isTemporary());
created = true;
} else if (dest.isTopic() && (addressSettings.isAutoCreateAddresses() || dest.isTemporary())) {
internalSession.createAddress(addressInfo, !dest.isTemporary());
created = true;
}
}
if (dest.isTemporary()) {
//Openwire needs to store the DestinationInfo in order to send
//Advisory messages to clients
this.state.addTempDestination(info);
}
if (created && !AdvisorySupport.isAdvisoryTopic(dest)) {
AMQConnectionContext context = getContext();
DestinationInfo advInfo = new DestinationInfo(context.getConnectionId(), DestinationInfo.ADD_OPERATION_TYPE, dest);
ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(dest);
protocolManager.fireAdvisory(context, topic, advInfo);
}
}
示例12: isMessageConsumedAdvisoryTopic
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isMessageConsumedAdvisoryTopic(ActiveMQDestination destination) {
if (destination.isComposite()) {
ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
for (int i = 0; i < compositeDestinations.length; i++) {
if (isMessageConsumedAdvisoryTopic(compositeDestinations[i])) {
return true;
}
}
return false;
} else {
return destination.isTopic() && destination.getPhysicalName().startsWith(MESSAGE_CONSUMED_TOPIC_PREFIX);
}
}
示例13: isMasterBrokerAdvisoryTopic
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isMasterBrokerAdvisoryTopic(ActiveMQDestination destination) {
if (destination.isComposite()) {
ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
for (int i = 0; i < compositeDestinations.length; i++) {
if (isMasterBrokerAdvisoryTopic(compositeDestinations[i])) {
return true;
}
}
return false;
} else {
return destination.isTopic() && destination.getPhysicalName().startsWith(MASTER_BROKER_TOPIC_PREFIX);
}
}
示例14: isMessageDeliveredAdvisoryTopic
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isMessageDeliveredAdvisoryTopic(ActiveMQDestination destination) {
if (destination.isComposite()) {
ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
for (int i = 0; i < compositeDestinations.length; i++) {
if (isMessageDeliveredAdvisoryTopic(compositeDestinations[i])) {
return true;
}
}
return false;
} else {
return destination.isTopic() && destination.getPhysicalName().startsWith(MESSAGE_DELIVERED_TOPIC_PREFIX);
}
}
示例15: isNetworkBridgeAdvisoryTopic
import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isNetworkBridgeAdvisoryTopic(ActiveMQDestination destination) {
if (destination.isComposite()) {
ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
for (int i = 0; i < compositeDestinations.length; i++) {
if (isNetworkBridgeAdvisoryTopic(compositeDestinations[i])) {
return true;
}
}
return false;
} else {
return destination.isTopic() && destination.getPhysicalName().startsWith(NETWORK_BRIDGE_TOPIC_PREFIX);
}
}