Package org.jenkinsci.plugins.variant
Class OptionalExtensionProcessor
java.lang.Object
hudson.ExtensionFinder.GuiceExtensionAnnotation<OptionalExtension>
org.jenkinsci.plugins.variant.OptionalExtensionProcessor
@Extension
public class OptionalExtensionProcessor
extends ExtensionFinder.GuiceExtensionAnnotation<OptionalExtension>
Processes extensions marked with
OptionalExtension
and decides when they are activated.- Author:
- Kohsuke Kawaguchi
-
Field Summary
Fields inherited from class hudson.ExtensionFinder.GuiceExtensionAnnotation
annotationType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double
getOrdinal
(OptionalExtension annotation) protected boolean
Go up the scope chain (method > class > package > ...) and make sure anyOptionalExtension
s we encounter are satisified.protected boolean
isOptional
(OptionalExtension annotation) If the trigger condition is not met, we filter it by not making the extension active, which means extensions could always be non-optional as far asExtensionFinder.GuiceExtensionAnnotation
is concerned.
-
Constructor Details
-
OptionalExtensionProcessor
public OptionalExtensionProcessor()
-
-
Method Details
-
getOrdinal
- Specified by:
getOrdinal
in classExtensionFinder.GuiceExtensionAnnotation<OptionalExtension>
-
isOptional
If the trigger condition is not met, we filter it by not making the extension active, which means extensions could always be non-optional as far asExtensionFinder.GuiceExtensionAnnotation
is concerned. But in some situations, the class cannot even be loaded which would makeExtensionFinder.GuiceExtensionAnnotation
to fail, so we need to also make it optional.See JENKINS-37317
- Specified by:
isOptional
in classExtensionFinder.GuiceExtensionAnnotation<OptionalExtension>
-
isActive
Go up the scope chain (method > class > package > ...) and make sure anyOptionalExtension
s we encounter are satisified.- Specified by:
isActive
in classExtensionFinder.GuiceExtensionAnnotation<OptionalExtension>
-