Class AbstractExtensionFinder
java.lang.Object
org.pf4j.AbstractExtensionFinder
- All Implemented Interfaces:
EventListener, ExtensionFinder, PluginStateListener
- Direct Known Subclasses:
LegacyExtensionFinder, ServiceProviderExtensionFinder
public abstract class AbstractExtensionFinder
extends Object
implements ExtensionFinder, PluginStateListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Booleanprotected Map<String, ExtensionInfo> private static final org.slf4j.Loggerprotected PluginManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckDifferentClassLoaders(Class<?> type, Class<?> extensionClass) private ExtensionWrappercreateExtensionWrapper(Class<?> extensionClass) protected voiddebugExtensions(Set<String> extensions) <T> List<ExtensionWrapper<T>> Retrieves a list with all extensions found for an extension point.<T> List<ExtensionWrapper<T>> Retrieves a list with all extensions found for an extension point and a plugin.Retrieves a list with all extensions found for a pluginfindClassNames(String pluginId) Retrieves a list with all extension class names found for a plugin.private ExtensionfindExtensionAnnotation(Class<?> clazz) private ExtensionInfogetExtensionInfo(String className, ClassLoader classLoader) Returns the parameters of anExtensionannotation without loading the corresponding class into the class loader.final booleanReturns true, if the extension finder checks extensions for its required plugins.voidInvoked when a plugin's state (for example DISABLED, STARTED) is changed.voidsetCheckForExtensionDependencies(boolean checkForExtensionDependencies) Plugin developers may enable / disable checks for required plugins of an extension.
-
Field Details
-
log
private static final org.slf4j.Logger log -
pluginManager
-
entries
-
extensionInfos
-
checkForExtensionDependencies
-
-
Constructor Details
-
AbstractExtensionFinder
-
-
Method Details
-
readPluginsStorages
-
readClasspathStorages
-
find
Description copied from interface:ExtensionFinderRetrieves a list with all extensions found for an extension point.- Specified by:
findin interfaceExtensionFinder
-
find
Description copied from interface:ExtensionFinderRetrieves a list with all extensions found for an extension point and a plugin.- Specified by:
findin interfaceExtensionFinder
-
find
Description copied from interface:ExtensionFinderRetrieves a list with all extensions found for a plugin- Specified by:
findin interfaceExtensionFinder
-
findClassNames
Description copied from interface:ExtensionFinderRetrieves a list with all extension class names found for a plugin.- Specified by:
findClassNamesin interfaceExtensionFinder
-
pluginStateChanged
Description copied from interface:PluginStateListenerInvoked when a plugin's state (for example DISABLED, STARTED) is changed.- Specified by:
pluginStateChangedin interfacePluginStateListener
-
isCheckForExtensionDependencies
public final boolean isCheckForExtensionDependencies()Returns true, if the extension finder checks extensions for its required plugins. This feature has to be enabled, in order check the availability ofExtension.plugins()configured by an extension.This feature is enabled by default, if at least one available plugin makes use of optional plugin dependencies. Those optional plugins might not be available at runtime. Therefore any extension is checked by default against available plugins before its instantiation.
Notice: This feature requires the optional ASM library to be available on the applications classpath.
- Returns:
- true, if the extension finder checks extensions for its required plugins
-
setCheckForExtensionDependencies
public void setCheckForExtensionDependencies(boolean checkForExtensionDependencies) Plugin developers may enable / disable checks for required plugins of an extension. This feature has to be enabled, in order check the availability ofExtension.plugins()configured by an extension.This feature is enabled by default, if at least one available plugin makes use of optional plugin dependencies. Those optional plugins might not be available at runtime. Therefore any extension is checked by default against available plugins before its instantiation.
Notice: This feature requires the optional ASM library to be available on the applications classpath.
- Parameters:
checkForExtensionDependencies- true to enable checks for optional extensions, otherwise false
-
debugExtensions
-
readStorages
-
getEntries
-
getExtensionInfo
Returns the parameters of anExtensionannotation without loading the corresponding class into the class loader. -
createExtensionWrapper
-
findExtensionAnnotation
-
checkDifferentClassLoaders
-