Camel
  1. Camel
  2. CAMEL-4358

Refactoring of management code to remove cycles and clearly separate between API and impl

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.9.0
    • Component/s: camel-core
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      Currently the management code (org.apache.camel.management.*) contains a mix of implementation code and APIs. This leads to cycle in the management code as well as to bigger cycles involving all of camel-core.

      So I propose to do several changes:

      • move interfaces and annotations that form the API to camel.spi.management. As these are probably not used by external components or user code no compatibility classes are created
      • create new package camel.suppport for classes that implement API or SPI classes and are expected to be extended by many impl classes. classes in support may only access the camel API and SPI
      • Move EventNotifierSupport and ServiceSupport to this package. Create deprecate dummys in the old locations to avoid breaking older code
      • Move DefaultEventFactory from management to management.event

      I will post a patch shortly for review

      1. CAMEL-4358-1.patch
        151 kB
        Christian Schneider

        Activity

        Christian Schneider made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Christian Schneider made changes -
        Attachment CAMEL-4358-1.patch [ 12491217 ]
        Christian Schneider made changes -
        Field Original Value New Value
        Summary Move org.apache.camel.management.Statistic to org.apache.camel.spi.Statistic Refactoring of management code to remove cycles and clearly separate between API and impl
        Patch Info [Patch Available]
        Description Currently Statistic.UpadateMode is used in org.apache.camel.spi.ManagementStrategy. The problem is that Statistic is located in org.apache.camel.management together with impl classes. So we have a dependency from an spi package to an impl package.

        I propose to move Statistic to spi as it is an interface and needed to implement a ManagementStrategy. I don´t think Statistic is used outside camel-core at the moment so I would like to do the change already for camel 2.9.0
        Currently the management code (org.apache.camel.management.*) contains a mix of implementation code and APIs. This leads to cycle in the management code as well as to bigger cycles involving all of camel-core.

        So I propose to do several changes:
        - move interfaces and annotations that form the API to camel.spi.management. As these are probably not used by external components or user code no compatibility classes are created
        - create new package camel.suppport for classes that implement API or SPI classes and are expected to be extended by many impl classes. classes in support may only access the camel API and SPI
        - Move EventNotifierSupport and ServiceSupport to this package. Create deprecate dummys in the old locations to avoid breaking older code
        - Move DefaultEventFactory from management to management.event

        I will post a patch shortly for review
        Christian Schneider created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development