@Internal public class DummyPlugin extends Object implements Plugin
Plugin implementation is required, however must be compatible with multiple
versions of that interface.
All methods are guaranteed to be implemented.Plugin.EnabledMetricsSource, Plugin.ResolvableNAME_COMPARATOR, VERSION_1, VERSION_2, VERSION_3| Constructor and Description |
|---|
DummyPlugin() |
| Modifier and Type | Method and Description |
|---|---|
void |
addModuleDescriptor(ModuleDescriptor<?> moduleDescriptor) |
void |
close()
Free any resources held by this plugin.
|
int |
compareTo(Plugin o) |
boolean |
containsSystemModule() |
void |
disable()
Disables the plugin.
|
void |
enable()
Enables the plugin.
|
Set<String> |
getActivePermissions() |
ClassLoader |
getClassLoader()
Get the classloader for the plugin.
|
Date |
getDateEnabled()
Obtain the date that the plugin system most recently completed enabling of this plugin.
|
Date |
getDateEnabling()
Obtain the date that the plugin system most recently commenced enabling this plugin.
|
Date |
getDateInstalled()
The date this plugin was installed into the system, is the same as the loaded date for non artifact backed plugins
|
Date |
getDateLoaded()
The date this plugin was loaded into the system.
|
PluginDependencies |
getDependencies()
Determines which plugin keys are dependencies, categorising them as mandatory, optional or dynamic.
|
String |
getI18nNameKey()
Returns the i18nKey used to get an internationalised name for this plugin.
|
InstallationMode |
getInstallationMode()
Gets the installation mode
|
String |
getKey() |
ModuleDescriptor<?> |
getModuleDescriptor(String key)
Get the
ModuleDescriptor for a particular key. |
Collection<ModuleDescriptor<?>> |
getModuleDescriptors()
Get the
Collection of descriptors. |
<M> List<ModuleDescriptor<M>> |
getModuleDescriptorsByModuleClass(Class<M> moduleClass)
Get the
descriptors whose module class implements or is assignable from the supplied Class. |
String |
getName()
Returns the non-localised name of this plugin if defined.
|
PluginArtifact |
getPluginArtifact()
Retrieve the original, unprocessed or transformed
PluginArtifact used to create this plugin instance. |
PluginInformation |
getPluginInformation() |
PluginState |
getPluginState()
Returns this plugin's current state.
|
int |
getPluginsVersion()
Gets the version of the plugins system to handle this plugin
|
Set<String> |
getRequiredPlugins() |
URL |
getResource(String path)
Retrieve the URL of the resource from the plugin.
|
InputStream |
getResourceAsStream(String name)
Load a given resource from the plugin.
|
ResourceDescriptor |
getResourceDescriptor(String type,
String name)
Get a
ResourceDescriptor of a particular type and name. |
List<ResourceDescriptor> |
getResourceDescriptors()
Get a
List of all the descriptors
. |
List<ResourceDescriptor> |
getResourceDescriptors(String type)
Get a list of all
descriptors of a particular
type. |
ResourceLocation |
getResourceLocation(String type,
String name)
Get a
ResourceLocation of a particular type and name. |
boolean |
hasAllPermissions() |
void |
install()
Installs the plugin into any internal, managing container.
|
boolean |
isBundledPlugin()
Whether the plugin is a "bundled" plugin that can't be removed.
|
boolean |
isDeleteable()
Should the plugin file be deleted on uninstall?
|
boolean |
isDynamicallyLoaded()
Whether or not this plugin is loaded dynamically at runtime.
|
boolean |
isEnabled() |
boolean |
isEnabledByDefault() |
boolean |
isSystemPlugin()
Whether the plugin is a "system" plugin that shouldn't be made visible to the user.
|
boolean |
isUninstallable()
Whether or not this plugin can be 'uninstalled'.
|
<T> Class<T> |
loadClass(String clazz,
Class<?> callingClass)
Get the plugin to load a specific class.
|
void |
resolve()
Perform any required resolution.
|
void |
setEnabled(boolean enabled) |
void |
setEnabledByDefault(boolean enabledByDefault) |
void |
setI18nNameKey(String i18nNameKey)
Sets the i18nKey used to get an internationalised name for this plugin.
|
void |
setKey(String aPackage) |
void |
setName(String name)
Sets the non-localised name of this plugin.
|
void |
setPluginInformation(PluginInformation pluginInformation) |
void |
setPluginsVersion(int version)
Sets the version of the plugins system
|
void |
setResources(Resourced resources) |
void |
setSystemPlugin(boolean system) |
void |
uninstall()
Uninstalls the plugin from any internal container.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetScopeKeypublic int getPluginsVersion()
PlugingetPluginsVersion in interface Pluginpublic void setPluginsVersion(int version)
PluginsetPluginsVersion in interface Pluginversion - The versionpublic String getName()
Plugin This corresponds to the value of the name field in the plugin's XML configuration file.
You would expect a plugin developer to fill in one of either name, or i18n-name-key,
but the framework does no validation and makes no guarantees that this is the case.
getName in interface PluginPlugin.getI18nNameKey()public void setName(String name)
PluginsetName in interface Pluginname - the name.Plugin.getName()public String getI18nNameKey()
Plugin This corresponds to the value of the i18n-name-key field in the plugin's XML configuration file.
You would expect a plugin developer to fill in one of either name, or i18n-name-key,
but the framework does no validation and makes no guarantees that this is the case.
getI18nNameKey in interface PluginPlugin.getName()public void setI18nNameKey(String i18nNameKey)
PluginsetI18nNameKey in interface Plugini18nNameKey - the i18n Name Key.Plugin.getI18nNameKey()public void addModuleDescriptor(ModuleDescriptor<?> moduleDescriptor)
addModuleDescriptor in interface Pluginpublic Collection<ModuleDescriptor<?>> getModuleDescriptors()
PluginCollection of descriptors.
The iteration order of the collection is the order that the modules will be enabled, and should be the same order that the modules appear in the plugin descriptor.
getModuleDescriptors in interface Pluginpublic ModuleDescriptor<?> getModuleDescriptor(String key)
PluginModuleDescriptor for a particular key. Returns null if the plugin does not exist.
Note: The ModuleDescriptor.getModule() may throw ClassCastException if the expected type is incorrect.
getModuleDescriptor in interface Pluginkey - the String complete key of the module, in the form "org.example.plugin:module-key".ModuleDescriptor of the expected type.public <M> List<ModuleDescriptor<M>> getModuleDescriptorsByModuleClass(Class<M> moduleClass)
Plugindescriptors whose module class implements or is assignable from the supplied Class.
Note: The ModuleDescriptor.getModule() may throw ClassCastException if the expected type is incorrect.
Normally this method would not be supplied with anything other than Object or <?>, unless you are
confident in the super type of the module classes this Plugin provides.
getModuleDescriptorsByModuleClass in interface PluginM - The expected module type of the returned descriptors.moduleClass - the super class the descriptors return.List of descriptors of the expected type.public InstallationMode getInstallationMode()
PlugingetInstallationMode in interface Pluginpublic boolean isEnabledByDefault()
isEnabledByDefault in interface Pluginpublic void setEnabledByDefault(boolean enabledByDefault)
setEnabledByDefault in interface Pluginpublic PluginInformation getPluginInformation()
getPluginInformation in interface Pluginpublic void setPluginInformation(PluginInformation pluginInformation)
setPluginInformation in interface Pluginpublic void setResources(Resourced resources)
setResources in interface Pluginpublic PluginState getPluginState()
PlugingetPluginState in interface Pluginpublic boolean isEnabled()
public boolean isSystemPlugin()
PluginisSystemPlugin in interface Plugintrue if this plugin is a "system" plugin.public void setSystemPlugin(boolean system)
setSystemPlugin in interface Pluginsystem - whether the plugin is a "system" plugin that shouldn't be made visible to the user.public boolean containsSystemModule()
containsSystemModule in interface Pluginpublic boolean isBundledPlugin()
PluginisBundledPlugin in interface Plugintrue if this plugin is a "bundled" plugin.public Date getDateLoaded()
PlugingetDateLoaded in interface Pluginpublic Date getDateInstalled()
PlugingetDateInstalled in interface Pluginpublic boolean isUninstallable()
PluginisUninstallable in interface Plugintrue if this plugin can be 'uninstalled'.public boolean isDeleteable()
PluginisDeleteable in interface Plugintrue if this plugin file should be deleted on uninstall.public boolean isDynamicallyLoaded()
PluginisDynamicallyLoaded in interface Plugintrue if this plugin is loaded dynamically at runtime.public <T> Class<T> loadClass(String clazz, Class<?> callingClass) throws ClassNotFoundException
PluginloadClass in interface Pluginclazz - The name of the class to be loadedcallingClass - The class calling the loading (used to help find a classloader)ClassNotFoundException - if the class cannot be located.public ClassLoader getClassLoader()
PlugingetClassLoader in interface Pluginpublic URL getResource(String path)
PlugingetResource in interface Pluginpath - the name of the resource to be loadedpublic InputStream getResourceAsStream(String name)
PlugingetResourceAsStream in interface Pluginname - The name of the resource to be loaded.public void setEnabled(boolean enabled)
setEnabled in interface Pluginenabled - new enabled statepublic void close()
PluginPlugin.public void install()
throws PluginException
PluginPluginState.INSTALLED state. If the plugin is already
in the PluginState.INSTALLED state, nothing will happen.install in interface PluginPluginException - If the plugin could not be installedpublic void uninstall()
throws PluginException
PluginPluginState.UNINSTALLED state. If the plugin is already
in the PluginState.UNINSTALLED state, nothing will happen.uninstall in interface PluginPluginException - If the plugin could not be uninstalledpublic void enable()
throws PluginException
PluginPluginState.ENABLING or PluginState.ENABLED state. If the plugin is already in the
PluginState.ENABLING or PluginState.ENABLED state, nothing will happen.enable in interface PluginPluginException - If the plugin could not be enabledpublic void disable()
throws PluginException
PluginPluginState.DISABLED
state. If the plugin is already in the PluginState.DISABLED state, nothing will happen.disable in interface PluginPluginException - If the plugin could not be disabledpublic Set<String> getRequiredPlugins()
getRequiredPlugins in interface Plugin@Nonnull public PluginDependencies getDependencies()
PlugingetDependencies in interface Pluginpublic Set<String> getActivePermissions()
getActivePermissions in interface Pluginpublic boolean hasAllPermissions()
hasAllPermissions in interface Plugintrue if the plugin has all the permissionspublic void resolve()
Plugin@Nullable public Date getDateEnabling()
PlugingetDateEnabling in interface PluginPluginState.ENABLING.@Nullable public Date getDateEnabled()
PlugingetDateEnabled in interface PluginPluginState.ENABLED,
if this was not before the most recent PluginState.ENABLING, otherwise null.public PluginArtifact getPluginArtifact()
PluginPluginArtifact used to create this plugin instance.
Note that this method may be removed without notice; it is for use only by the host application.
This method was originally part of the internal PluginArtifactBackedPlugin interface that is no
longer present.
getPluginArtifact in interface Pluginpublic int compareTo(Plugin o)
compareTo in interface Comparable<Plugin>public List<ResourceDescriptor> getResourceDescriptors()
ResourcedList of all the descriptors
.
Note: since 2.2 this list must be immutable, previously modifying this list could modify the underlying list.
getResourceDescriptors in interface Resourcedpublic List<ResourceDescriptor> getResourceDescriptors(String type)
Resourceddescriptors of a particular
type.
Note: since 2.2 this list must be immutable, previously this list was modifiable but modifications would not be reflected in the underlying list.
getResourceDescriptors in interface Resourcedpublic ResourceDescriptor getResourceDescriptor(String type, String name)
ResourcedResourceDescriptor of a particular type and name.getResourceDescriptor in interface Resourcedpublic ResourceLocation getResourceLocation(String type, String name)
ResourcedResourceLocation of a particular type and name.getResourceLocation in interface ResourcedCopyright © 2018 Atlassian. All rights reserved.