|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PluginAccessor
Allows access to the current plugin system state
| Nested Class Summary | |
|---|---|
static class |
PluginAccessor.Descriptor
The plugin descriptor file. |
| Method Summary | ||
|---|---|---|
ClassLoader |
getClassLoader()
Retrieve the class loader responsible for loading classes and resources from plugins. |
|
Class<?> |
getDynamicPluginClass(String className)
Deprecated. since 0.21 this method is not used, use getPlugin(String).getClassLoader().loadClass(String) |
|
InputStream |
getDynamicResourceAsStream(String resourcePath)
Retrieve a resource from a currently loaded (and active) dynamically loaded plugin. |
|
|
getEnabledModuleDescriptorsByClass(Class<D> descriptorClazz)
Get all enabled module descriptors that have a specific descriptor class. |
|
|
getEnabledModuleDescriptorsByClass(Class<D> descriptorClazz,
boolean verbose)
Deprecated. Since 2.3.0, use #getEnabledModuleDescriptorsByClass(Class instead |
|
|
getEnabledModuleDescriptorsByType(String type)
Deprecated. since 0.17, use getModuleDescriptors(com.atlassian.plugin.predicate.ModuleDescriptorPredicate) with an appropriate predicate instead. |
|
|
getEnabledModulesByClass(Class<M> moduleClass)
Retrieve all plugin modules that implement or extend a specific class. |
|
|
getEnabledModulesByClassAndDescriptor(Class<ModuleDescriptor<M>>[] descriptorClazz,
Class<M> moduleClass)
Deprecated. since 0.17, use getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate) with an appropriate predicate instead. |
|
|
getEnabledModulesByClassAndDescriptor(Class<ModuleDescriptor<M>> descriptorClass,
Class<M> moduleClass)
Deprecated. since 0.17, use getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate) with an appropriate predicate instead. |
|
Plugin |
getEnabledPlugin(String pluginKey)
Retrieve a given plugin if it is enabled. |
|
ModuleDescriptor<?> |
getEnabledPluginModule(String completeKey)
Retrieve an enabled plugin module by complete module key. |
|
Collection<Plugin> |
getEnabledPlugins()
Get all of the currently enabled plugins. |
|
|
getModuleDescriptors(ModuleDescriptorPredicate<M> moduleDescriptorPredicate)
Gets all module descriptors of installed modules that match the given predicate. |
|
|
getModules(ModuleDescriptorPredicate<M> moduleDescriptorPredicate)
Gets all installed modules that match the given predicate. |
|
Plugin |
getPlugin(String key)
Retrieve a given plugin (whether enabled or not). |
|
ModuleDescriptor<?> |
getPluginModule(String completeKey)
Retrieve any plugin module by complete module key. |
|
InputStream |
getPluginResourceAsStream(String pluginKey,
String resourcePath)
Deprecated. since 0.21 this method is not used, use getPlugin(String).getClassLoader().getResourceAsStream(String) |
|
PluginRestartState |
getPluginRestartState(String key)
Gets the state of the plugin upon restart. |
|
Collection<Plugin> |
getPlugins()
Gets all of the currently installed plugins. |
|
Collection<Plugin> |
getPlugins(PluginPredicate pluginPredicate)
Gets all installed plugins that match the given predicate. |
|
boolean |
isPluginEnabled(String key)
Whether or not a given plugin is currently enabled. |
|
boolean |
isPluginModuleEnabled(String completeKey)
Whether or not a given plugin module is currently enabled. |
|
boolean |
isSystemPlugin(String key)
|
|
| Method Detail |
|---|
Collection<Plugin> getPlugins()
Plugins.Collection<Plugin> getPlugins(PluginPredicate pluginPredicate)
pluginPredicate - the PluginPredicate to match.
Plugins that match the given predicate.Collection<Plugin> getEnabledPlugins()
Plugins.<M> Collection<M> getModules(ModuleDescriptorPredicate<M> moduleDescriptorPredicate)
moduleDescriptorPredicate - the ModuleDescriptorPredicate to match.
ModuleDescriptor.getModule() that match the given predicate.<M> Collection<ModuleDescriptor<M>> getModuleDescriptors(ModuleDescriptorPredicate<M> moduleDescriptorPredicate)
moduleDescriptorPredicate - the ModuleDescriptorPredicate to match.
ModuleDescriptors that match the given predicate.
Plugin getPlugin(String key)
throws IllegalArgumentException
key - The plugin key. Cannot be null.
IllegalArgumentException - If the plugin key is null
Plugin getEnabledPlugin(String pluginKey)
throws IllegalArgumentException
IllegalArgumentException - If the plugin key is nullModuleDescriptor<?> getPluginModule(String completeKey)
Note: the module may or may not be disabled.
ModuleDescriptor<?> getEnabledPluginModule(String completeKey)
boolean isPluginEnabled(String key)
throws IllegalArgumentException
IllegalArgumentException - If the plugin key is nullboolean isPluginModuleEnabled(String completeKey)
isPluginEnabled(String)<M> List<M> getEnabledModulesByClass(Class<M> moduleClass)
@Deprecated
<M> List<M> getEnabledModulesByClassAndDescriptor(Class<ModuleDescriptor<M>>[] descriptorClazz,
Class<M> moduleClass)
getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate) with an appropriate predicate instead.
descriptorClazz - @NotNullmoduleClass - @NotNull
@Deprecated
<M> List<M> getEnabledModulesByClassAndDescriptor(Class<ModuleDescriptor<M>> descriptorClass,
Class<M> moduleClass)
getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate) with an appropriate predicate instead.
descriptorClass - @NotNullmoduleClass - @NotNull
<D extends ModuleDescriptor<?>> List<D> getEnabledModuleDescriptorsByClass(Class<D> descriptorClazz)
descriptorClazz - module descriptor class
ModuleDescriptors that implement or extend the given class.
<D extends ModuleDescriptor<?>> List<D> getEnabledModuleDescriptorsByClass(Class<D> descriptorClazz,
boolean verbose)
#getEnabledModuleDescriptorsByClass(Class) instead
descriptorClazz - module descriptor classverbose - log verbose messages flag
ModuleDescriptors that implement or extend the given class.
@Deprecated
<M> List<ModuleDescriptor<M>> getEnabledModuleDescriptorsByType(String type)
throws PluginParseException
getModuleDescriptors(com.atlassian.plugin.predicate.ModuleDescriptorPredicate) with an appropriate predicate instead.
ModuleDescriptors that are of a given type.
PluginParseExceptionInputStream getDynamicResourceAsStream(String resourcePath)
resourcePath - the path to the resource to retrieve
@Deprecated
InputStream getPluginResourceAsStream(String pluginKey,
String resourcePath)
getPlugin(String).getClassLoader().getResourceAsStream(String)
@Deprecated
Class<?> getDynamicPluginClass(String className)
throws ClassNotFoundException
getPlugin(String).getClassLoader().loadClass(String)
className - the name of the class to retrieve
ClassNotFoundException - thrown if no classes by that name could be found in any of the enabled dynamic pluginsClassLoader getClassLoader()
boolean isSystemPlugin(String key)
PluginRestartState getPluginRestartState(String key)
key - The plugin key
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||