Package hudson
Class ExtensionFinder.GuiceFinder
java.lang.Object
hudson.ExtensionFinder
hudson.ExtensionFinder.GuiceFinder
- All Implemented Interfaces:
ExtensionPoint
- Enclosing class:
- ExtensionFinder
Discovers components via sezpoz but instantiates them by using Guice.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.ExtensionFinder
ExtensionFinder.DefaultGuiceExtensionAnnotation, ExtensionFinder.GuiceExtensionAnnotation<T extends Annotation>, ExtensionFinder.GuiceFinder, ExtensionFinder.Sezpoz
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.google.inject.Scope
Scope
that allows a failure to create a component, and change the value to null. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<U> Collection<ExtensionComponent<U>>
Discover extensions of the given type.com.google.inject.Injector
refresh()
The basic idea is: List up delta as a series of modulesvoid
TODO: need to learn more about concurrent access toInjector
and how it interacts with classloading.Methods inherited from class hudson.ExtensionFinder
_find, findExtensions, isRefreshable
-
Field Details
-
FAULT_TOLERANT_SCOPE
public static final com.google.inject.Scope FAULT_TOLERANT_SCOPEScope
that allows a failure to create a component, and change the value to null.This is necessary as a failure to load one plugin shouldn't fail the startup of the entire Jenkins. Instead, we should just drop the failing plugins.
-
-
Constructor Details
-
GuiceFinder
public GuiceFinder()
-
-
Method Details
-
getContainer
public com.google.inject.Injector getContainer() -
refresh
The basic idea is:- List up delta as a series of modules
- Specified by:
refresh
in classExtensionFinder
- Returns:
- never null
- Throws:
ExtensionRefreshException
- See Also:
-
find
Description copied from class:ExtensionFinder
Discover extensions of the given type.This method is called only once per the given type after all the plugins are loaded, so implementations need not worry about caching.
This method should return all the known components at the time of the call, including those that are discovered later via
ExtensionFinder.refresh()
, even though those components are separately returned inExtensionComponentSet
.- Specified by:
find
in classExtensionFinder
- Type Parameters:
U
- The type of the extension points. This is not bound toExtensionPoint
because ofDescriptor
, which by itself doesn't implementExtensionPoint
for a historical reason.jenkins
- Jenkins whose behalf this extension finder is performing lookup.- Returns:
- Can be empty but never null.
-
scout
TODO: need to learn more about concurrent access toInjector
and how it interacts with classloading.- Overrides:
scout
in classExtensionFinder
-