Camel
  1. Camel
  2. CAMEL-547

remove cycle between builder and spi

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.4.0
    • Component/s: camel-core
    • Labels:
      None

      Description

      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?

      1. Main cluster (11).png
        27 kB
        Christian Schneider
      2. routecontext.patch
        2 kB
        Christian Schneider

        Issue Links

          Activity

          Jeff Turner made changes -
          Project Import Sat Nov 27 00:14:50 EST 2010 [ 1290834890113 ]
          Claus Ibsen made changes -
          Fix Version/s 1.5.0 [ 11922 ]
          Fix Version/s 1.4.0 [ 11849 ]
          Christian Schneider made changes -
          Resolution Duplicate [ 3 ]
          Status Open [ 1 ] Closed [ 6 ]
          Christian Schneider made changes -
          Link This issue is superceded by CAMEL-588 [ CAMEL-588 ]
          Claus Ibsen made changes -
          Fix Version/s 1.4.0 [ 11849 ]
          Fix Version/s 1.5.0 [ 11922 ]
          Christian Schneider made changes -
          Attachment routecontext.patch [ 16519 ]
          Claus Ibsen made changes -
          Link This issue is related to CAMEL-527 [ CAMEL-527 ]
          Hadrian Zbarcea made changes -
          Assignee Hadrian Zbarcea [ hadrian ]
          Christian Schneider made changes -
          Field Original Value New Value
          Attachment Main cluster (11).png [ 16481 ]
          Christian Schneider created issue -

            People

            • Assignee:
              Hadrian Zbarcea
              Reporter:
              Christian Schneider
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3h
                3h
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development