in collector/camel/src/main/java/org/apache/karaf/decanter/collector/camel/DecanterEventNotifier.java [127:153]
public boolean isEnabled(CamelEvent eventObject) {
if (eventObject == null) {
return false;
}
if (isIgnored(eventObject)) {
return false;
}
Object source = eventObject.getSource();
if (source instanceof Exchange) {
Exchange exchange = (Exchange)source;
boolean contextMatches = exchange.getContext().getName().matches(camelContextMatcher);
if (exchange.getFromRouteId() != null) {
return exchange.getFromRouteId().matches(routeMatcher) && contextMatches;
} else {
return contextMatches;
}
} else if (source instanceof CamelContext) {
CamelContext context = (CamelContext)eventObject.getSource();
return context.getName().matches(camelContextMatcher);
} else if (source instanceof Route) {
Route route = (Route)source;
boolean contextMatches = route.getCamelContext().getName().matches(camelContextMatcher);
return contextMatches && route.getId().matches(routeMatcher);
} else {
return false;
}
}