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


Java ActiveMQDestination.isComposite方法代码示例

本文整理汇总了Java中org.apache.activemq.command.ActiveMQDestination.isComposite方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQDestination.isComposite方法的具体用法?Java ActiveMQDestination.isComposite怎么用?Java ActiveMQDestination.isComposite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.command.ActiveMQDestination的用法示例。


在下文中一共展示了ActiveMQDestination.isComposite方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * Looks up the value(s) matching the given Destination key. For simple
 * destinations this is typically a List of one single value, for wildcards
 * or composite destinations this will typically be a Union of matching
 * values.
 *
 * @param key the destination to lookup
 * @return a Union of matching values or an empty list if there are no
 *         matching values.
 */
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public synchronized Set get(ActiveMQDestination key) {
    if (key.isComposite()) {
        ActiveMQDestination[] destinations = key.getCompositeDestinations();
        Set answer = null;
        for (int i = 0; i < destinations.length; i++) {
            ActiveMQDestination childDestination = destinations[i];
            answer = union(answer, get(childDestination));
            if (answer == null  || answer.isEmpty()) {
                break;
            }
        }
        return answer;
    }
    return findWildcardMatches(key);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:28,代码来源:DefaultAuthorizationMap.java

示例2: send

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * 
 */
public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception {
    ActiveMQDestination destination = message.getDestination();
    if (destination.isComposite()) {
        ActiveMQDestination[] destinations = destination.getCompositeDestinations();
        for (int i = 0; i < destinations.length; i++) {
            if (i != 0) {
                message = message.copy();
                message.setMemoryUsage(null);
            }
            message.setOriginalDestination(destination);
            message.setDestination(destinations[i]);
            next.send(producerExchange, message);
        }
    } else {
        next.send(producerExchange, message);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:21,代码来源:CompositeDestinationBroker.java

示例3: get

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * Looks up the value(s) matching the given Destination key. For simple
 * destinations this is typically a List of one single value, for wildcards
 * or composite destinations this will typically be a List of matching
 * values.
 *
 * @param key the destination to lookup
 * @return a List of matching values or an empty list if there are no
 *         matching values.
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public synchronized Set get(ActiveMQDestination key) {
    if (key.isComposite()) {
        ActiveMQDestination[] destinations = key.getCompositeDestinations();
        Set answer = new HashSet(destinations.length);
        for (int i = 0; i < destinations.length; i++) {
            ActiveMQDestination childDestination = destinations[i];
            Object value = get(childDestination);
            if (value instanceof Set) {
                answer.addAll((Set)value);
            } else if (value != null) {
                answer.add(value);
            }
        }
        return answer;
    }
    return findWildcardMatches(key);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:29,代码来源:DestinationMap.java

示例4: getExportDestinationFilter

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * Do extra processing to filter out destinations.  This is because the destination filter
 * will match some destianations that we don't want.  For example, "test.queue" will match
 * as true for the pattern "test.queue.>" which is not correct.
 * @param destPattern
 * @return
 */
private Predicate<ActiveMQDestination> getExportDestinationFilter(final ActiveMQDestination destPattern) {
    //We need to check each composite destination individually
    final List<ActiveMQDestination> nonComposite = destPattern.isComposite()
            ? Arrays.asList(destPattern.getCompositeDestinations()) : Arrays.asList(destPattern);

    return (e) -> {
        boolean match = false;
        for (ActiveMQDestination d : nonComposite) {
            String destString = d.getPhysicalName();
            //don't match a.b when using a.b.>
            if (destPattern.isPattern() && destString.length() > 1 && destString.endsWith(DestinationFilter.ANY_DESCENDENT)) {
                final String startsWithString = destString.substring(0, destString.length() - 2);
                match = e.getPhysicalName().startsWith(startsWithString) && !e.getPhysicalName().equals(startsWithString);
            //non wildcard should be an exact match
            } else if (!destPattern.isPattern()) {
                match = e.getPhysicalName().equals(destString);
            } else {
                match = true;
            }
            if (match) {
                break;
            }
        }

        return match;
    };

}
 
开发者ID:apache,项目名称:activemq-cli-tools,代码行数:36,代码来源:KahaDBExporter.java

示例5: createConsumer

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public List<AMQConsumer> createConsumer(ConsumerInfo info,
                                        SlowConsumerDetectionListener slowConsumerDetectionListener) throws Exception {
   //check destination
   ActiveMQDestination dest = info.getDestination();
   ActiveMQDestination[] dests = null;
   if (dest.isComposite()) {
      dests = dest.getCompositeDestinations();
   } else {
      dests = new ActiveMQDestination[]{dest};
   }

   List<AMQConsumer> consumersList = new java.util.LinkedList<>();

   for (ActiveMQDestination openWireDest : dests) {
      boolean isInternalAddress = false;
      if (AdvisorySupport.isAdvisoryTopic(dest)) {
         if (!connection.isSuppportAdvisory()) {
            continue;
         }
         isInternalAddress = connection.isSuppressInternalManagementObjects();
      }
      if (openWireDest.isQueue()) {
         SimpleString queueName = new SimpleString(convertWildcard(openWireDest.getPhysicalName()));

         if (!checkAutoCreateQueue(queueName, openWireDest.isTemporary())) {
            throw new InvalidDestinationException("Destination doesn't exist: " + queueName);
         }
      }
      AMQConsumer consumer = new AMQConsumer(this, openWireDest, info, scheduledPool, isInternalAddress);

      long nativeID = consumerIDGenerator.generateID();
      consumer.init(slowConsumerDetectionListener, nativeID);
      consumersList.add(consumer);
   }

   return consumersList;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:38,代码来源:AMQSession.java

示例6: isConnectionAdvisoryTopic

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isConnectionAdvisoryTopic(ActiveMQDestination destination) {
    if (destination.isComposite()) {
        ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
        for (int i = 0; i < compositeDestinations.length; i++) {
            if (isConnectionAdvisoryTopic(compositeDestinations[i])) {
                return true;
            }
        }
        return false;
    } else {
        return destination.equals(CONNECTION_ADVISORY_TOPIC);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例7: removeAll

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * @param key
 * @return
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public Set removeAll(ActiveMQDestination key) {
    Set rc = new HashSet();
    if (key.isComposite()) {
        ActiveMQDestination[] destinations = key.getCompositeDestinations();
        for (int i = 0; i < destinations.length; i++) {
            rc.add(removeAll(destinations[i]));
        }
        return rc;
    }
    String[] paths = key.getDestinationPaths();
    getRootNode(key).removeAll(rc, paths, 0);
    return rc;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:19,代码来源:DestinationMap.java

示例8: put

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public synchronized void put(ActiveMQDestination key, Object value) {
    if (key.isComposite()) {
        ActiveMQDestination[] destinations = key.getCompositeDestinations();
        for (int i = 0; i < destinations.length; i++) {
            ActiveMQDestination childDestination = destinations[i];
            put(childDestination, value);
        }
        return;
    }
    String[] paths = key.getDestinationPaths();
    getRootNode(key).add(paths, 0, value);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:DestinationMap.java

示例9: isFastProducerAdvisoryTopic

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isFastProducerAdvisoryTopic(ActiveMQDestination destination) {
    if (destination.isComposite()) {
        ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
        for (int i = 0; i < compositeDestinations.length; i++) {
            if (isFastProducerAdvisoryTopic(compositeDestinations[i])) {
                return true;
            }
        }
        return false;
    } else {
        return destination.isTopic() && destination.getPhysicalName().startsWith(FAST_PRODUCER_TOPIC_PREFIX);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例10: 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

示例11: 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

示例12: 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

示例13: isMessageDiscardedAdvisoryTopic

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
public static boolean isMessageDiscardedAdvisoryTopic(ActiveMQDestination destination) {
    if (destination.isComposite()) {
        ActiveMQDestination[] compositeDestinations = destination.getCompositeDestinations();
        for (int i = 0; i < compositeDestinations.length; i++) {
            if (isMessageDiscardedAdvisoryTopic(compositeDestinations[i])) {
                return true;
            }
        }
        return false;
    } else {
        return destination.isTopic() && destination.getPhysicalName().startsWith(MESSAGE_DISCAREDED_TOPIC_PREFIX);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:AdvisorySupport.java

示例14: 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

示例15: addProducer

import org.apache.activemq.command.ActiveMQDestination; //导入方法依赖的package包/类
/**
 * A producer may register to send to multiple destinations via a composite
 * destination.
 */
public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception {
    // The destination may be null.
    ActiveMQDestination destination = info.getDestination();
    if (destination != null && destination.isComposite()) {
        ActiveMQDestination[] destinations = destination.getCompositeDestinations();
        for (int i = 0; i < destinations.length; i++) {
            ProducerInfo copy = info.copy();
            copy.setDestination(destinations[i]);
            next.addProducer(context, copy);
        }
    } else {
        next.addProducer(context, info);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:19,代码来源:CompositeDestinationBroker.java


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