/** * Strategy to install all available routes into the context */ protected void installRoutes() throws Exception { List<RouteBuilder> builders = new ArrayList<RouteBuilder>(); // lets add RoutesBuilder's added from references if (getBuilderRefs() != null) { for (RouteBuilderDefinition builderRef : getBuilderRefs()) { RoutesBuilder routes = builderRef.createRoutes(getContext()); if (routes != null) { this.builders.add(routes); } else { throw new CamelException("Cannot find any routes with this RouteBuilder reference: " + builderRef); } } } // install already configured routes for (RoutesBuilder routeBuilder : this.builders) { getContext().addRoutes(routeBuilder); } // install builders for (RouteBuilder builder : builders) { // Inject the annotated resource postProcessBeforeInit(builder); getContext().addRoutes(builder); } }
public List<RouteBuilderDefinition> getBuilderRefs() { return builderRefs; }
public void setBuilderRefs(List<RouteBuilderDefinition> builderRefs) { this.builderRefs = builderRefs; }
@Override public List<RouteBuilderDefinition> getBuilderRefs() { return _factoryBean.getBuilderRefs(); }
public abstract List<RouteBuilderDefinition> getBuilderRefs();