Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-8897

Allow PluginStrategy implementations complete control over finding components

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      By default the core uses a service lookup mechanism called sezpoz (http://sezpoz.java.net/) to find its components. This process can be extended via the ExtensionFinder extension point which lets containers (such as Plexus) supply additional means of finding components (like META-INF/plexus/components.xml). Unfortunately this approach doesn't give containers enough control over the lookup process because:

      a) sezpoz is always consulted first, so additional ExtensionFinders have to be careful to not duplicate its results

      b) ExtensionFinders can only be found by sezpoz (to avoid a potential infinite recursion when finding finders...)

      c) sezpoz components always appear before other results, which means they cannot be replaced or removed

      This feature request proposes adding a new method to the PluginStrategy extension point which takes a component type and scope and returns a list of components:

      public abstract <T> List<ExtensionComponent<T>> findComponents(Class<T> type, Hudson hudson);
      

      The current ExtensionFinder approach can then be moved into the ClassicPluginStrategy class. This maintains the default lookup behaviour while allowing other PluginStrategy implementations the option of completely changing how components are found and wired up.

      PS. this feature request was previously raised as http://issues.hudson-ci.org/browse/HUDSON-8735 and in an earlier form as http://issues.hudson-ci.org/browse/HUDSON-7061. The change was pulled into Hudson via https://github.com/hudson/hudson/pull/1 and it would be great if the same change (or something with similar functionality) could be integrated in Jenkins as well to maintain core compatibility.

      Comments/suggestions/constructive-criticisms are very welcome.

            Unassigned Unassigned
            mcculls Stuart McCulloch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: