本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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;
};
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}