|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.impl.AbstractDelegatingPlugin
public abstract class AbstractDelegatingPlugin
Delegating plugin that supports easy wrapping
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.atlassian.plugin.AutowireCapablePlugin |
|---|
AutowireCapablePlugin.AutowireStrategy |
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.plugin.Plugin |
|---|
NAME_COMPARATOR |
| Constructor Summary | |
|---|---|
AbstractDelegatingPlugin(Plugin delegate)
|
|
| Method Summary | ||
|---|---|---|
void |
addModuleDescriptor(ModuleDescriptor<?> moduleDescriptor)
|
|
|
autowire(java.lang.Class<T> clazz)
Creates and autowires a class using the default strategy. |
|
|
autowire(java.lang.Class<T> clazz,
AutowireCapablePlugin.AutowireStrategy autowireStrategy)
Creates and autowires a class with a specific autowire strategy |
|
void |
autowire(java.lang.Object instance)
Autowires an existing object using the default strategy. |
|
void |
autowire(java.lang.Object instance,
AutowireCapablePlugin.AutowireStrategy autowireStrategy)
Autowires an existing object with a specific autowire strategy |
|
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. |
|
boolean |
equals(java.lang.Object obj)
|
|
java.lang.ClassLoader |
getClassLoader()
Get the classloader for the plugin. |
|
java.util.Date |
getDateLoaded()
The date this plugin was loaded into the system. |
|
Plugin |
getDelegate()
|
|
java.lang.String |
getI18nNameKey()
Returns the i18nKey used to get an internationalised name for this plugin. |
|
java.lang.String |
getKey()
|
|
ModuleDescriptor<?> |
getModuleDescriptor(java.lang.String key)
Get the ModuleDescriptor for a particular key. |
|
java.util.Collection<ModuleDescriptor<?>> |
getModuleDescriptors()
Get the Collection of descriptors. |
|
|
getModuleDescriptorsByModuleClass(java.lang.Class<M> moduleClass)
Get the descriptors whose module class implements or is assignable from the supplied Class. |
|
java.lang.String |
getName()
Returns the non-localised name of this plugin if defined. |
|
PluginInformation |
getPluginInformation()
|
|
PluginState |
getPluginState()
Returns this plugin's current state. |
|
int |
getPluginsVersion()
Gets the version of the plugins system to handle this plugin |
|
java.util.Set<java.lang.String> |
getRequiredPlugins()
|
|
java.net.URL |
getResource(java.lang.String path)
Retrieve the URL of the resource from the plugin. |
|
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Load a given resource from the plugin. |
|
ResourceDescriptor |
getResourceDescriptor(java.lang.String type,
java.lang.String name)
Get a ResourceDescriptor of a particular type and name. |
|
java.util.List<ResourceDescriptor> |
getResourceDescriptors()
Get a List of all the descriptors
. |
|
java.util.List<ResourceDescriptor> |
getResourceDescriptors(java.lang.String type)
Get a list of all descriptors of a particular
type. |
|
ResourceLocation |
getResourceLocation(java.lang.String type,
java.lang.String name)
Get a ResourceLocation of a particular type and name. |
|
int |
hashCode()
|
|
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 unistall? |
|
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'. |
|
|
loadClass(java.lang.String clazz,
java.lang.Class<?> callingClass)
Get the plugin to load a specific class. |
|
void |
setEnabled(boolean enabled)
|
|
void |
setEnabledByDefault(boolean enabledByDefault)
|
|
void |
setI18nNameKey(java.lang.String i18nNameKey)
Sets the i18nKey used to get an internationalised name for this plugin. |
|
void |
setKey(java.lang.String aPackage)
|
|
void |
setName(java.lang.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)
|
|
java.lang.String |
toString()
|
|
void |
uninstall()
Uninstalls the plugin from any internal container. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDelegatingPlugin(Plugin delegate)
| Method Detail |
|---|
public int getPluginsVersion()
Plugin
getPluginsVersion in interface Pluginpublic void setPluginsVersion(int version)
Plugin
setPluginsVersion in interface Pluginversion - The versionpublic java.lang.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(java.lang.String name)
Plugin
setName in interface Pluginname - the name.Plugin.getName()public java.lang.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(java.lang.String i18nNameKey)
Plugin
setI18nNameKey in interface Plugini18nNameKey - the i18n Name Key.Plugin.getI18nNameKey()public java.lang.String getKey()
getKey in interface Pluginpublic void setKey(java.lang.String aPackage)
setKey in interface Pluginpublic void addModuleDescriptor(ModuleDescriptor<?> moduleDescriptor)
addModuleDescriptor in interface Pluginpublic java.util.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(java.lang.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> java.util.List<ModuleDescriptor<M>> getModuleDescriptorsByModuleClass(java.lang.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 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()
Plugin
getPluginState in interface Pluginpublic boolean isEnabled()
isEnabled in interface Plugintrue if this plugin is enabled.public boolean isSystemPlugin()
Plugin
isSystemPlugin in interface Plugintrue if this plugin is a "system" plugin.public boolean containsSystemModule()
containsSystemModule in interface Pluginpublic 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 isBundledPlugin()
Plugin
isBundledPlugin in interface Plugintrue if this plugin is a "bundled" plugin.public java.util.Date getDateLoaded()
Plugin
getDateLoaded in interface Pluginpublic boolean isUninstallable()
Plugin
isUninstallable in interface Plugintrue if this plugin can be 'uninstalled'.public boolean isDeleteable()
Plugin
isDeleteable in interface Plugintrue if this plugin file should be deleted on unistall.public boolean isDynamicallyLoaded()
Plugin
isDynamicallyLoaded in interface Plugintrue if this plugin is loaded dynamically at runtime.
public <T> java.lang.Class<T> loadClass(java.lang.String clazz,
java.lang.Class<?> callingClass)
throws java.lang.ClassNotFoundException
Plugin
loadClass in interface Pluginclazz - The name of the class to be loadedcallingClass - The class calling the loading (used to help find a classloader)
java.lang.ClassNotFoundException - if the class cannot be located.public java.lang.ClassLoader getClassLoader()
Plugin
getClassLoader in interface Pluginpublic java.net.URL getResource(java.lang.String path)
Plugin
getResource in interface Pluginpath - the name of the resource to be loaded
public java.io.InputStream getResourceAsStream(java.lang.String name)
Plugin
getResourceAsStream 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.
close in interface Pluginpublic void install()
PluginPluginState.INSTALLED state. If the plugin is already
in the PluginState.INSTALLED state, nothing will happen.
install in interface Pluginpublic void uninstall()
PluginPluginState.UNINSTALLED state. If the plugin is already
in the PluginState.UNINSTALLED state, nothing will happen.
uninstall in interface Pluginpublic void enable()
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 Pluginpublic void disable()
PluginPluginState.DISABLED
state. If the plugin is already in the PluginState.DISABLED state, nothing will happen.
disable in interface Pluginpublic java.util.Set<java.lang.String> getRequiredPlugins()
getRequiredPlugins in interface Pluginpublic java.util.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 java.util.List<ResourceDescriptor> getResourceDescriptors(java.lang.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 Resourced
public ResourceDescriptor getResourceDescriptor(java.lang.String type,
java.lang.String name)
ResourcedResourceDescriptor of a particular type and name.
getResourceDescriptor in interface Resourced
public ResourceLocation getResourceLocation(java.lang.String type,
java.lang.String name)
ResourcedResourceLocation of a particular type and name.
getResourceLocation in interface Resourcedpublic int compareTo(Plugin o)
compareTo in interface java.lang.Comparable<Plugin>public Plugin getDelegate()
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
public <T> T autowire(java.lang.Class<T> clazz)
throws java.lang.UnsupportedOperationException
AutowireCapablePlugin
autowire in interface AutowireCapablePluginclazz - The class to create
java.lang.UnsupportedOperationException - If the underlying delegate doesn't
implement AutowireCapablePlugin
public <T> T autowire(java.lang.Class<T> clazz,
AutowireCapablePlugin.AutowireStrategy autowireStrategy)
throws java.lang.UnsupportedOperationException
AutowireCapablePlugin
autowire in interface AutowireCapablePluginclazz - The class to createautowireStrategy - The autowire strategy
java.lang.UnsupportedOperationException - If the underlying delegate doesn't
implement AutowireCapablePlugin
public void autowire(java.lang.Object instance)
throws java.lang.UnsupportedOperationException
AutowireCapablePlugin
autowire in interface AutowireCapablePlugininstance - The object to inject
java.lang.UnsupportedOperationException - If the underlying delegate doesn't
implement AutowireCapablePlugin
public void autowire(java.lang.Object instance,
AutowireCapablePlugin.AutowireStrategy autowireStrategy)
throws java.lang.UnsupportedOperationException
AutowireCapablePlugin
autowire in interface AutowireCapablePlugininstance - The object to autowireautowireStrategy - The autowire strategy, must not be constructor
java.lang.UnsupportedOperationException - If the underlying delegate doesn't
implement AutowireCapablePlugin
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||