Hi Eric,

Please check out the link below

http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html 

Once you have routes in XML you can store them in any backing store,
repository or file. You can instantiate the routes in Spring (shown in the
link) or DSL. Based on what you are saying it seems like for the time-being
you need to do this to happen in a processor.

The code is quite simple. All you need to do is

a> Read the routeContext along with its routes into a list
ArrayList<RouteDefinition> routes = 
        (ArrayList<RouteDefinition>)
getCamelContext().getApplicationContext().
        getBean("serviceRoute", ArrayList.class);

b> Fire up the routes as follows...
getCamelContext().addRouteDefinitions(routes);

Hope this helps for the time-being...

Cheers,

Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com
http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Abstracting-Routes-using-Components-tp3234703p3238075.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to