return containsPolicy(getRequired(exchange), policy);
}
@SuppressWarnings("unchecked")
private static Set<Policy> getPolicies(Exchange exchange, String propertyName) {
Property intentsProperty = exchange.getContext().getProperty(propertyName, Scope.EXCHANGE);
Set<Policy> intents = new HashSet<Policy>();
if (intentsProperty != null) {
intents.addAll((Set<Policy>)intentsProperty.getValue());
}
return intents;
}