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

Allow PluginStrategy implementations complete control over finding components

    • 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.

          [JENKINS-8897] Allow PluginStrategy implementations complete control over finding components

          Stuart McCulloch added a comment - Pull request opened at https://github.com/jenkinsci/jenkins/pull/64

          Code changed in jenkins
          User: Stuart McCulloch
          Path:
          core/src/main/java/hudson/ClassicPluginStrategy.java
          core/src/main/java/hudson/DescriptorExtensionList.java
          core/src/main/java/hudson/ExtensionList.java
          core/src/main/java/hudson/PluginStrategy.java
          http://jenkins-ci.org/commit/core/998752442a1dabbca82bdbe577167477a5925153
          Log:
          JENKINS-8897

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stuart McCulloch Path: core/src/main/java/hudson/ClassicPluginStrategy.java core/src/main/java/hudson/DescriptorExtensionList.java core/src/main/java/hudson/ExtensionList.java core/src/main/java/hudson/PluginStrategy.java http://jenkins-ci.org/commit/core/998752442a1dabbca82bdbe577167477a5925153 Log: JENKINS-8897

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/core/1d0473140f367fa658286fe4847baa4d83b7fc0d
          Log:
          [FIXED JENKINS-8897] recording the previous change.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/core/1d0473140f367fa658286fe4847baa4d83b7fc0d Log: [FIXED JENKINS-8897] recording the previous change.

          dogfood added a comment -

          dogfood added a comment - Integrated in jenkins_main_trunk #548

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

              Created:
              Updated:
              Resolved: