java.lang.Object | ||
↳ | com.atlassian.plugin.impl.AbstractPlugin | |
↳ | com.atlassian.plugin.osgi.factory.OsgiPlugin |
Plugin that wraps an OSGi bundle that does contain a plugin descriptor. The actual bundle is not created until the
install()
method is invoked. Any attempt to access a method that requires a bundle will throw an
IllegalPluginStateException
.
This class uses a OsgiPluginHelper to represent different behaviors of key methods in different states.
OsgiPluginUninstalledHelper implements the methods when the plugin hasn't yet been installed into the
OSGi container, while OsgiPluginInstalledHelper implements the methods when the bundle is available. This
leaves this class to manage the PluginState
and interactions with the event system.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ATLASSIAN_PLUGIN_KEY |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.atlassian.plugin.Plugin
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates and autowires the class, using Spring's autodetection algorithm
| |||||||||||
Autowires the instance
| |||||||||||
Autowires the instance using Spring's autodetection algorithm
| |||||||||||
Creates and autowires the class
| |||||||||||
Get the classloader for the plugin.
| |||||||||||
Determines which plugins are required for this one to operate based on tracing the "wires" or packages that
are imported by this plugin.
| |||||||||||
Retrieve the URL of the resource from the plugin.
| |||||||||||
Load a given resource from the plugin.
| |||||||||||
Should the plugin file be deleted on unistall?
| |||||||||||
Whether or not this plugin is loaded dynamically at runtime.
| |||||||||||
Whether or not this plugin can be 'uninstalled'.
| |||||||||||
Get the plugin to load a specific class.
| |||||||||||
Called when the spring context for the bundle has failed to be created.
| |||||||||||
Called when the spring context for the bundle has been created or refreshed.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Disables the plugin by changing the bundle state back to resolved
| |||||||||||
Enables the plugin by setting the OSGi bundle state to enabled.
| |||||||||||
Installs the plugin artifact into OSGi
| |||||||||||
Uninstalls the bundle from the OSGi container
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.plugin.impl.AbstractPlugin
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.plugin.AutowireCapablePlugin
| |||||||||||
From interface
com.atlassian.plugin.Plugin
| |||||||||||
From interface
com.atlassian.plugin.PluginArtifactBackedPlugin
| |||||||||||
From interface
com.atlassian.plugin.Resourced
| |||||||||||
From interface
com.atlassian.plugin.module.ContainerManagedPlugin
| |||||||||||
From interface
java.lang.Comparable
|
Creates and autowires the class, using Spring's autodetection algorithm
clazz | The class to create |
---|
IllegalPluginStateException | if the bundle hasn't been created yet |
---|
Autowires the instance
instance | The object to autowire |
---|---|
autowireStrategy | The autowire strategy, must not be constructor |
IllegalPluginStateException | if the bundle hasn't been created yet |
---|
Autowires the instance using Spring's autodetection algorithm
instance | The object to inject |
---|
IllegalPluginStateException | if the bundle hasn't been created yet |
---|---|
IllegalStateException |
Creates and autowires the class
clazz | The class to create |
---|---|
autowireStrategy | The autowire strategy |
IllegalPluginStateException | if the bundle hasn't been created yet |
---|
Get the classloader for the plugin.
IllegalPluginStateException | if the bundle hasn't been created yet |
---|
Determines which plugins are required for this one to operate based on tracing the "wires" or packages that are imported by this plugin. Bundles that provide those packages are determined to be required plugins.
IllegalPluginStateException |
---|
Retrieve the URL of the resource from the plugin.
name | The resource name |
---|
IllegalPluginStateException | if the bundle hasn't been created yet |
---|
Load a given resource from the plugin. Plugins that are loaded dynamically will need to implement this in a way that loads the resource from the same context as the plugin. Static plugins can just pull them from their own classloader.
name | The name of the resource to be loaded. |
---|
IllegalPluginStateException | if the bundle hasn't been created yet |
---|
Should the plugin file be deleted on unistall?
Whether or not this plugin is loaded dynamically at runtime.
Whether or not this plugin can be 'uninstalled'.
Get the plugin to load a specific class.
clazz | The name of the class to be loaded |
---|---|
callingClass | The class calling the loading (used to help find a classloader) |
ClassNotFoundException | If the class cannot be found |
---|---|
IllegalPluginStateException | if the bundle hasn't been created yet |
Called when the spring context for the bundle has failed to be created. This means the bundle is still active, but the Spring context is not available, so for our purposes, the plugin shouldn't be enabled.
event | The plugin container failed event |
---|
IllegalPluginStateException | If the plugin key hasn't been set yet |
---|
Called when the spring context for the bundle has been created or refreshed. If this is the first time the context has been refreshed, then it is a new context. Otherwise, this means that the bundle has been reloaded, usually due to a dependency upgrade.
event | The event |
---|
IllegalPluginStateException | If the plugin key hasn't been set yet |
---|
Disables the plugin by changing the bundle state back to resolved
OsgiContainerException | If the OSGi system threw an exception |
---|---|
IllegalPluginStateException | if the bundle hasn't been created yet |
Enables the plugin by setting the OSGi bundle state to enabled.
OsgiContainerException | If the underlying OSGi system threw an exception or we tried to enable the bundle when it was in an invalid state |
---|---|
IllegalPluginStateException | if the bundle hasn't been created yet |
Installs the plugin artifact into OSGi
IllegalPluginStateException | if the bundle hasn't been created yet |
---|
Uninstalls the bundle from the OSGi container
OsgiContainerException | If the underlying OSGi system threw an exception |
---|---|
IllegalPluginStateException | if the bundle hasn't been created yet |