Search in sources :

Example 1 with RouteContextRefDefinition

use of org.apache.camel.model.RouteContextRefDefinition in project camel by apache.

the class AbstractCamelContextFactoryBean method initRouteRefs.

protected void initRouteRefs() throws Exception {
    // add route refs to existing routes
    if (getRouteRefs() != null) {
        for (RouteContextRefDefinition ref : getRouteRefs()) {
            List<RouteDefinition> defs = ref.lookupRoutes(getContext());
            for (RouteDefinition def : defs) {
                LOG.debug("Adding route from {} -> {}", ref, def);
                // add in top as they are most likely to be common/shared
                // which you may want to start first
                getRoutes().add(0, def);
            }
        }
    }
}
Also used : RouteContextRefDefinition(org.apache.camel.model.RouteContextRefDefinition) RouteDefinition(org.apache.camel.model.RouteDefinition)

Aggregations

RouteContextRefDefinition (org.apache.camel.model.RouteContextRefDefinition)1 RouteDefinition (org.apache.camel.model.RouteDefinition)1