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 withOptionalExtension
and decides when they are activated.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
-
Fields inherited from class hudson.ExtensionFinder.GuiceExtensionAnnotation
annotationType
-
-
Constructor Summary
Constructors Constructor Description OptionalExtensionProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
getOrdinal(OptionalExtension annotation)
protected boolean
isActive(AnnotatedElement e)
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.
-
-
-
Method Detail
-
getOrdinal
protected double getOrdinal(OptionalExtension annotation)
- Specified by:
getOrdinal
in classExtensionFinder.GuiceExtensionAnnotation<OptionalExtension>
-
isOptional
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. 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
protected boolean isActive(AnnotatedElement e)
Go up the scope chain (method > class > package > ...) and make sure anyOptionalExtension
s we encounter are satisified.- Specified by:
isActive
in classExtensionFinder.GuiceExtensionAnnotation<OptionalExtension>
-
-