当前位置: 首页>>代码示例>>Java>>正文


Java ActiveMQDestination.isTopic方法代码示例

本文整理汇总了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;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:26,代码来源:NetworkConnector.java

示例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);
            }
        }
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:26,代码来源:DurableConduitBridge.java

示例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;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:17,代码来源:AdvisorySupport.java

示例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);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:26,代码来源:ManagedRegionBroker.java

示例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);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:21,代码来源:QueueSubscriptionTest.java

示例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;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:ArtemisBrokerWrapper.java

示例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;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:40,代码来源:DiscardingDLQBroker.java

示例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);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例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);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例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);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例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);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:38,代码来源:OpenWireConnection.java

示例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);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例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);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例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);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例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);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java


注:本文中的org.apache.activemq.command.ActiveMQDestination.isTopic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。