|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.impl.AbstractPlugin
com.atlassian.plugin.osgi.factory.OsgiBundlePlugin
public class OsgiBundlePlugin
Plugin that wraps an OSGi bundle that has no plugin descriptor.
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.plugin.Plugin |
|---|
NAME_COMPARATOR |
| Constructor Summary | |
|---|---|
OsgiBundlePlugin(org.osgi.framework.Bundle bundle,
java.lang.String key,
PluginEventManager pluginEventManager)
|
|
| Method Summary | ||
|---|---|---|
void |
addModuleDescriptor(ModuleDescriptor<?> moduleDescriptor)
|
|
boolean |
containsSystemModule()
|
|
protected void |
disableInternal()
Perform any internal disabling logic. |
|
protected PluginState |
enableInternal()
Perform any internal enabling logic. |
|
java.lang.ClassLoader |
getClassLoader()
Get the classloader for the plugin. |
|
java.util.Date |
getDateLoaded()
The date this plugin was loaded into the system. |
|
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()
Returns a copy of the module descriptors for this plugin |
|
|
getModuleDescriptorsByModuleClass(java.lang.Class<M> aClass)
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()
|
|
int |
getPluginsVersion()
Gets the version of the plugins system to handle this plugin |
|
java.net.URL |
getResource(java.lang.String name)
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. |
|
boolean |
isDeleteable()
Should the plugin file be deleted on unistall? |
|
boolean |
isDynamicallyLoaded()
Whether or not this plugin is loaded dynamically at runtime. |
|
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 |
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)
|
|
protected void |
uninstallInternal()
Perform any internal uninstallation logic. |
|
| Methods inherited from class com.atlassian.plugin.impl.AbstractPlugin |
|---|
close, compareTo, disable, enable, getLog, getPluginState, getRequiredPlugins, install, installInternal, isBundledPlugin, isEnabled, removeModuleDescriptor, setEnabled, setPluginState, toString, uninstall |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OsgiBundlePlugin(org.osgi.framework.Bundle bundle,
java.lang.String key,
PluginEventManager pluginEventManager)
| Method Detail |
|---|
public int getPluginsVersion()
Plugin
getPluginsVersion in interface PlugingetPluginsVersion in class AbstractPluginpublic void setPluginsVersion(int version)
Plugin
setPluginsVersion in interface PluginsetPluginsVersion in class AbstractPluginversion - 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 PlugingetName in class AbstractPluginPlugin.getI18nNameKey()public void setName(java.lang.String name)
Plugin
setName in interface PluginsetName in class AbstractPluginname - 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 PlugingetI18nNameKey in class AbstractPluginPlugin.getName()public void setI18nNameKey(java.lang.String i18nNameKey)
Plugin
setI18nNameKey in interface PluginsetI18nNameKey in class AbstractPlugini18nNameKey - the i18n Name Key.Plugin.getI18nNameKey()public java.lang.String getKey()
getKey in interface PlugingetKey in class AbstractPluginpublic void setKey(java.lang.String aPackage)
setKey in interface PluginsetKey in class AbstractPluginpublic void addModuleDescriptor(ModuleDescriptor<?> moduleDescriptor)
addModuleDescriptor in interface PluginaddModuleDescriptor in class AbstractPluginpublic java.util.Collection<ModuleDescriptor<?>> getModuleDescriptors()
AbstractPlugin
getModuleDescriptors in interface PlugingetModuleDescriptors in class AbstractPluginpublic 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 PlugingetModuleDescriptor in class AbstractPluginkey - 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> aClass)
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 PlugingetModuleDescriptorsByModuleClass in class AbstractPluginM - The expected module type of the returned descriptors.aClass - the super class the descriptors return.
List of descriptors of the expected type.public boolean isEnabledByDefault()
isEnabledByDefault in interface PluginisEnabledByDefault in class AbstractPluginpublic void setEnabledByDefault(boolean enabledByDefault)
setEnabledByDefault in interface PluginsetEnabledByDefault in class AbstractPluginpublic PluginInformation getPluginInformation()
getPluginInformation in interface PlugingetPluginInformation in class AbstractPluginpublic void setPluginInformation(PluginInformation pluginInformation)
setPluginInformation in interface PluginsetPluginInformation in class AbstractPluginpublic void setResources(Resourced resources)
setResources in interface PluginsetResources in class AbstractPluginpublic boolean isSystemPlugin()
Plugin
isSystemPlugin in interface PluginisSystemPlugin in class AbstractPlugintrue if this plugin is a "system" plugin.public boolean containsSystemModule()
containsSystemModule in interface PlugincontainsSystemModule in class AbstractPluginpublic void setSystemPlugin(boolean system)
setSystemPlugin in interface PluginsetSystemPlugin in class AbstractPluginpublic java.util.Date getDateLoaded()
Plugin
getDateLoaded in interface PlugingetDateLoaded in class AbstractPluginpublic boolean isUninstallable()
Plugin
true if this plugin can be 'uninstalled'.public boolean isDeleteable()
Plugin
true if this plugin file should be deleted on unistall.public boolean isDynamicallyLoaded()
Plugin
true if this plugin is loaded dynamically at runtime.public java.util.List<ResourceDescriptor> getResourceDescriptors()
Resourceddescriptors.
Note: since 2.2 this list must be immutable, previously modifying this list could modify the underlying list.
getResourceDescriptors in interface ResourcedgetResourceDescriptors in class AbstractPluginpublic 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 ResourcedgetResourceDescriptors in class AbstractPlugin
public ResourceLocation getResourceLocation(java.lang.String type,
java.lang.String name)
ResourcedResourceLocation of a particular type and name.
getResourceLocation in interface ResourcedgetResourceLocation in class AbstractPlugin
public ResourceDescriptor getResourceDescriptor(java.lang.String type,
java.lang.String name)
ResourcedResourceDescriptor of a particular type and name.
getResourceDescriptor in interface ResourcedgetResourceDescriptor in class AbstractPlugin
public <T> java.lang.Class<T> loadClass(java.lang.String clazz,
java.lang.Class<?> callingClass)
throws java.lang.ClassNotFoundException
Plugin
clazz - 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.net.URL getResource(java.lang.String name)
Plugin
name - the name of the resource to be loaded
public java.io.InputStream getResourceAsStream(java.lang.String name)
Plugin
name - The name of the resource to be loaded.
protected void uninstallInternal()
AbstractPluginPluginException.
uninstallInternal in class AbstractPluginprotected PluginState enableInternal()
AbstractPluginPluginException.
enableInternal in class AbstractPluginPluginState.ENABLED or PluginState.ENABLINGprotected void disableInternal()
AbstractPluginPluginException.
disableInternal in class AbstractPluginpublic java.lang.ClassLoader getClassLoader()
Plugin
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||