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.
Field Summary |
static com.google.inject.Scope |
FAULT_TOLERANT_SCOPE
Scope that allows a failure to create a component,
and change the value to null. |
Method Summary |
|
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 modules
|
void |
scout(Class extensionType,
Hudson hudson)
TODO: need to learn more about concurrent access to Injector and how it interacts
with classloading. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
ExtensionFinder.GuiceFinder
public ExtensionFinder.GuiceFinder()
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 class ExtensionFinder
- 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 in ExtensionComponentSet
.
- Specified by:
find
in class ExtensionFinder
- Type Parameters:
U
- The type of the extension points. This is not bound to ExtensionPoint
because
of Descriptor
, which by itself doesn't implement ExtensionPoint
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 to
Injector
and how it interacts
with classloading.
- Overrides:
scout
in class ExtensionFinder
Copyright © 2004-2013. All Rights Reserved.