public interface PluginAccessor
| Modifier and Type | Interface and Description |
|---|---|
static class |
PluginAccessor.Descriptor
The plugin descriptor file.
|
| Modifier and Type | Method and Description |
|---|---|
ClassLoader |
getClassLoader()
Retrieve the class loader responsible for loading classes and resources from plugins.
|
Class<?> |
getDynamicPluginClass(String className)
Deprecated.
|
InputStream |
getDynamicResourceAsStream(String resourcePath)
Retrieve a resource from a currently loaded (and active) dynamically loaded plugin.
|
<D extends ModuleDescriptor<?>> |
getEnabledModuleDescriptorsByClass(Class<D> descriptorClazz)
Get all enabled module descriptors that have a specific descriptor class.
|
<D extends ModuleDescriptor<?>> |
getEnabledModuleDescriptorsByClass(Class<D> descriptorClazz,
boolean verbose)
Deprecated.
Since 2.3.0, use
#getEnabledModuleDescriptorsByClass(Class instead |
<M> List<ModuleDescriptor<M>> |
getEnabledModuleDescriptorsByType(String type)
Deprecated.
since 0.17, use
getModuleDescriptors(com.atlassian.plugin.predicate.ModuleDescriptorPredicate) with an appropriate predicate instead. |
<M> List<M> |
getEnabledModulesByClass(Class<M> moduleClass)
Retrieve all plugin modules that implement or extend a specific class.
|
<M> List<M> |
getEnabledModulesByClassAndDescriptor(Class<ModuleDescriptor<M>>[] descriptorClazz,
Class<M> moduleClass)
Deprecated.
since 0.17, use
getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate) with an appropriate predicate instead. |
<M> List<M> |
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.
|
<M> Collection<ModuleDescriptor<M>> |
getModuleDescriptors(ModuleDescriptorPredicate<M> moduleDescriptorPredicate)
Gets all module descriptors of installed modules that match the given predicate.
|
<M> Collection<M> |
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) |
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 nullPlugin 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 classModuleDescriptors that implement or extend the given class.<D extends ModuleDescriptor<?>> List<D> getEnabledModuleDescriptorsByClass(Class<D> descriptorClazz, boolean verbose)
#getEnabledModuleDescriptorsByClass(Class) insteaddescriptorClazz - module descriptor classverbose - log verbose messages flagModuleDescriptors 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 retrieveClassNotFoundException - 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 keyCopyright © 2014 Atlassian. All rights reserved.