Camel
  1. Camel
  2. CAMEL-5308

Main is bound to DefaultCamelContext

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.9.2
    • Fix Version/s: 2.10.0
    • Component/s: camel-core
    • Labels:
      None
    • Environment:

      any

    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Novice

      Description

      We are using our own CamelContext, which is extending the DefaultCamelContext. Using Main is impossible in this case, since the getCamelContextMap()-method creates statically a DefaultCamelContext. Overriding this method doesn't works either, since the field registery is final, and no other accessors are defined.

      The given path doesn't breaks existing code bases, and gives an easy possiblity to override the context-creation, as well as access to the registry.

      1. Main.java.patch
        1 kB
        Daniel Galán y Martins

        Activity

        Claus Ibsen made changes -
        Priority Major [ 3 ] Trivial [ 5 ]
        Claus Ibsen made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Claus Ibsen [ davsclaus ]
        Fix Version/s 2.10.0 [ 12317612 ]
        Resolution Fixed [ 1 ]
        Hide
        Claus Ibsen added a comment -

        Thanks for the patch.

        Show
        Claus Ibsen added a comment - Thanks for the patch.
        Daniel Galán y Martins made changes -
        Description We are using our own CamelContext, which is extending the DefaultCamelContext. Using Main is impossible in this case, since the {{getCamelContextMap()}}-method creates statically a DefaultCamelContext. Overriding this method doesn't works either, since the field {{registery}} is final, and no other accessors are defined.

        We are using our own CamelContext, which is extending the DefaultCamelContext. Using Main is impossible in this case, since the {{getCamelContextMap()}}-method creates statically a DefaultCamelContext. Overriding this method doesn't works either, since the field {{registery}} is final, and no other accessors are defined.

        The given path doesn't breaks existing code bases, and gives an easy possiblity to override the context-creation, as well as access to the registry.
        Daniel Galán y Martins made changes -
        Field Original Value New Value
        Attachment Main.java.patch [ 12529707 ]
        Daniel Galán y Martins created issue -

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            Daniel Galán y Martins
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development