}
private void initPolicies(RouteType route) {
// setup the policies as JAXB yet again have not created a correct model for us
List<ProcessorType<?>> types = route.getOutputs();
PolicyRef policy = null;
for (ProcessorType<?> type : types) {
if (type instanceof PolicyRef) {
policy = (PolicyRef) type;
} else if (policy != null) {
// the outputs should be moved to the policy
policy.addOutput(type);
}
}
// did we find a policy if so add replace it as the only output on the route
if (policy != null) {
route.clearOutput();