[ 
https://issues.apache.org/activemq/browse/CAMEL-547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christian Schneider updated CAMEL-547:
--------------------------------------

    Attachment: routecontext.patch

Small modifications in RouteContext and RouteType to make initialization easier 
and cleaner

> remove cycle between builder and spi
> ------------------------------------
>
>                 Key: CAMEL-547
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-547
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Christian Schneider
>            Assignee: Hadrian Zbarcea
>            Priority: Critical
>             Fix For: 1.4.0
>
>         Attachments: Main cluster (11).png, routecontext.patch
>
>
> Currently the spi package references builder.RouteBuilder. This creates a bad 
> cycle in Camel as builder is one of the top level packages and spi is one of 
> the lowest level packages. The method where RouteBuilder is used is in 
> CamelContext.addRoutes(RouteBuilder builder). I think this reference is not 
> necessary. CamelContext already has a method addRoutes(Collection<Route> 
> routes). 
> So instead of calling camelContext.addRoutes(builder) I think the better way 
> would to call:
> builder.setContext(camelContext);
> builder.addRoutesToContext(); // This is a new method that replaces the 
> functionality of CamelContext.addRoutes(RouteBuilder builder)
> This way we will also cut some part of the cycle between impl and builder. 
> impl.DefaultCamelContext references both RouteBuilder and BuilderSupport from 
> the builder package. Both will not be necessary anymore as as soon as we get 
> rid of the addRoutes method.
> This way CamelContext does not have to know anything about it´s builder. What 
> do you think about this change?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to