Package hudson
Class ExtensionFinder.GuiceFinder
- java.lang.Object
-
- hudson.ExtensionFinder
-
- hudson.ExtensionFinder.GuiceFinder
-
- All Implemented Interfaces:
ExtensionPoint
- Enclosing class:
- ExtensionFinder
@Extension public static class ExtensionFinder.GuiceFinder extends 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
Fields Modifier and Type Field Description static com.google.inject.Scope
FAULT_TOLERANT_SCOPE
Scope
that allows a failure to create a component, and change the value to null.
-
Constructor Summary
Constructors Constructor Description GuiceFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <U> Collection<ExtensionComponent<U>>
find(Class<U> type, Hudson jenkins)
Discover extensions of the given type.com.google.inject.Injector
getContainer()
ExtensionComponentSet
refresh()
The basic idea is: List up delta as a series of modulesvoid
scout(Class extensionType, Hudson hudson)
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 Detail
-
FAULT_TOLERANT_SCOPE
public static final com.google.inject.Scope FAULT_TOLERANT_SCOPE
Scope
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.
-
-
Method Detail
-
getContainer
public com.google.inject.Injector getContainer()
-
refresh
public ExtensionComponentSet refresh() throws ExtensionRefreshException
The basic idea is:- List up delta as a series of modules
- Specified by:
refresh
in classExtensionFinder
- Returns:
- never null
- Throws:
ExtensionRefreshException
- See Also:
ExtensionFinder.isRefreshable()
-
find
public <U> Collection<ExtensionComponent<U>> find(Class<U> type, Hudson jenkins)
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
public void scout(Class extensionType, Hudson hudson)
TODO: need to learn more about concurrent access toInjector
and how it interacts with classloading.- Overrides:
scout
in classExtensionFinder
-
-