org.apache.camel.model
Class RouteContextRefDefinitionHelper

java.lang.Object
  extended by org.apache.camel.model.RouteContextRefDefinitionHelper

public final class RouteContextRefDefinitionHelper
extends Object

Helper for RouteContextRefDefinition.


Method Summary
static List<RouteDefinition> lookupRoutes(CamelContext camelContext, String ref)
          Lookup the routes from the RouteContextRefDefinition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lookupRoutes

public static List<RouteDefinition> lookupRoutes(CamelContext camelContext,
                                                 String ref)
Lookup the routes from the RouteContextRefDefinition.

This implmementation must be used to lookup the routes as it performs a deep clone of the routes as a RouteContextRefDefinition can be re-used with multiple CamelContext and each context should have their own instances of the routes. This is to ensure no side-effefts and sharing of instances between the contexts. For example such as property placeholders may be context specific so the routes should not use placeholders from another CamelContext.

Parameters:
camelContext - the CamelContext
ref - the id of the RouteContextRefDefinition to lookup and get the rotues.
Returns:
the routes.


Apache Camel