本文整理汇总了Java中org.apache.activemq.command.ConsumerInfo.getSelector方法的典型用法代码示例。如果您正苦于以下问题:Java ConsumerInfo.getSelector方法的具体用法?Java ConsumerInfo.getSelector怎么用?Java ConsumerInfo.getSelector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.command.ConsumerInfo
的用法示例。
在下文中一共展示了ConsumerInfo.getSelector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseSelector
import org.apache.activemq.command.ConsumerInfo; //导入方法依赖的package包/类
private static BooleanExpression parseSelector(ConsumerInfo info) throws InvalidSelectorException {
BooleanExpression rc = null;
if (info.getSelector() != null) {
rc = SelectorParser.parse(info.getSelector());
}
if (info.isNoLocal()) {
if (rc == null) {
rc = new NoLocalExpression(info.getConsumerId().getConnectionId());
} else {
rc = LogicExpression.createAND(new NoLocalExpression(info.getConsumerId().getConnectionId()), rc);
}
}
if (info.getAdditionalPredicate() != null) {
if (rc == null) {
rc = info.getAdditionalPredicate();
} else {
rc = LogicExpression.createAND(info.getAdditionalPredicate(), rc);
}
}
return rc;
}
示例2: addConsumer
import org.apache.activemq.command.ConsumerInfo; //导入方法依赖的package包/类
@Override
public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
LOG.debug("Caching consumer selector [{}] on a {}", info.getSelector(), info.getDestination().getQualifiedName());
String selector = info.getSelector();
// As ConcurrentHashMap doesn't support null values, use always true expression
if (selector == null) {
selector = "TRUE";
}
subSelectorCache.put(info.getDestination().getQualifiedName(), selector);
return super.addConsumer(context, info);
}
示例3: hasDurableSubChanged
import org.apache.activemq.command.ConsumerInfo; //导入方法依赖的package包/类
private boolean hasDurableSubChanged(ConsumerInfo info1, ConsumerInfo info2) {
if (info1.getSelector() != null ^ info2.getSelector() != null) {
return true;
}
if (info1.getSelector() != null && !info1.getSelector().equals(info2.getSelector())) {
return true;
}
return !info1.getDestination().equals(info2.getDestination());
}