@Extension public static class ExtensionFinder.GuiceFinder extends ExtensionFinder
ExtensionFinder.DefaultGuiceExtensionAnnotation, ExtensionFinder.GuiceExtensionAnnotation<T extends Annotation>, ExtensionFinder.GuiceFinder, ExtensionFinder.Sezpoz
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and 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 and Description |
---|
GuiceFinder() |
Modifier and Type | Method and 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 modules
|
void |
scout(Class extensionType,
Hudson hudson)
TODO: need to learn more about concurrent access to
Injector and how it interacts
with classloading. |
_find, findExtensions, isRefreshable
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.
public com.google.inject.Injector getContainer()
public ExtensionComponentSet refresh() throws ExtensionRefreshException
refresh
in class ExtensionFinder
ExtensionRefreshException
ExtensionFinder.isRefreshable()
public <U> Collection<ExtensionComponent<U>> find(Class<U> type, Hudson jenkins)
ExtensionFinder
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
.
find
in class ExtensionFinder
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.public void scout(Class extensionType, Hudson hudson)
Injector
and how it interacts
with classloading.scout
in class ExtensionFinder
Copyright © 2004–2022. All rights reserved.