Class OsgiBundlePlugin
- All Implemented Interfaces:
com.atlassian.plugin.module.ContainerManagedPlugin,OsgiBackedPlugin,com.atlassian.plugin.Plugin,com.atlassian.plugin.PluginInternal,com.atlassian.plugin.Resourced,com.atlassian.plugin.ScopeAware,Comparable<com.atlassian.plugin.Plugin>,EventListener,org.osgi.framework.BundleListener,org.osgi.framework.SynchronousBundleListener
That kind of plugins might have or do not have plugin descriptor and must manage internal IoC by themselves if it is present. Note that some modules require access to plugin IoC to work properly so it is plugin responsibility to provide a such access and manage internal container lifecycle.
To export any container to PluginsFramework bundle should export ContainerAccessor interface implementation as a service before move to ACTIVE state. Behavior is not defined if plugin provides more then one instances of ContainerAccessor Plugin of that type has lifecycle duplicates underlying OSGi Bundle natural states
-
Field Summary
Fields inherited from class com.atlassian.plugin.impl.AbstractPlugin
pluginArtifactFields inherited from interface com.atlassian.plugin.Plugin
VERSION_1, VERSION_2, VERSION_3 -
Constructor Summary
ConstructorsConstructorDescriptionOsgiBundlePlugin(OsgiContainerManager osgiContainerManager, String pluginKey, com.atlassian.plugin.PluginArtifact pluginArtifact) Create a plugin wrapper which installs the bundle when the plugin is installed. -
Method Summary
Modifier and TypeMethodDescriptionvoidbundleChanged(org.osgi.framework.BundleEvent event) protected voidprotected com.atlassian.plugin.PluginStateorg.osgi.framework.BundleReturnsOSGi Bundlethat corresponds to the current plugincom.atlassian.plugin.module.ContainerAccessorcom.atlassian.plugin.PluginDependenciesgetResource(String name) getResourceAsStream(String name) protected voidbooleanbooleanboolean<T> Class<T>voidresolve()protected voidMethods inherited from class com.atlassian.plugin.impl.AbstractPlugin
addDynamicModuleDescriptor, addModuleDescriptor, cleanVersionString, close, compareAndSetPluginState, compareTo, containsSystemModule, disable, enable, getActivePermissions, getDateEnabled, getDateEnabling, getDynamicModuleDescriptors, getI18nNameKey, getInstallationMode, getKey, getLog, getModuleDescriptor, getModuleDescriptors, getModuleDescriptorsByModuleClass, getName, getPluginArtifact, getPluginInformation, getPluginState, getPluginsVersion, getRequiredPlugins, getResourceDescriptor, getResourceDescriptors, getResourceLocation, getScopeKey, hasAllPermissions, install, isBundledPlugin, isEnabledByDefault, isSystemPlugin, removeDynamicModuleDescriptor, removeModuleDescriptor, setBundledPlugin, setEnabledByDefault, setI18nNameKey, setKey, setName, setPluginInformation, setPluginState, setPluginsVersion, setResources, setSystemPlugin, toString, uninstallMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.atlassian.plugin.Plugin
addModuleDescriptor, containsSystemModule, disable, enable, getActivePermissions, getDateEnabled, getDateEnabling, getI18nNameKey, getInstallationMode, getKey, getModuleDescriptor, getModuleDescriptors, getModuleDescriptorsByModuleClass, getName, getPluginArtifact, getPluginInformation, getPluginState, getPluginsVersion, hasAllPermissions, install, isBundledPlugin, isEnabledByDefault, isSystemPlugin, setEnabledByDefault, setI18nNameKey, setKey, setName, setPluginInformation, setPluginsVersion, setResources, setSystemPlugin, uninstallMethods inherited from interface com.atlassian.plugin.Resourced
getResourceDescriptor, getResourceDescriptors, getResourceLocationMethods inherited from interface com.atlassian.plugin.ScopeAware
getScopeKey
-
Constructor Details
-
OsgiBundlePlugin
public OsgiBundlePlugin(OsgiContainerManager osgiContainerManager, String pluginKey, com.atlassian.plugin.PluginArtifact pluginArtifact) Create a plugin wrapper which installs the bundle when the plugin is installed.- Parameters:
osgiContainerManager- the container to install into when the plugin is installed.pluginKey- The plugin key.pluginArtifact- The The plugin artifact to install.
-
-
Method Details
-
getBundle
public org.osgi.framework.Bundle getBundle()Description copied from interface:OsgiBackedPluginReturnsOSGi Bundlethat corresponds to the current pluginNote that
Bundlecould be not available on some ofPluginlifecycle stages. In that case method call results inIllegalPluginStateException- Specified by:
getBundlein interfaceOsgiBackedPlugin- Returns:
OSGirepresentation of the current plugin
-
getDateLoaded
- Specified by:
getDateLoadedin interfacecom.atlassian.plugin.Plugin- Overrides:
getDateLoadedin classcom.atlassian.plugin.impl.AbstractPlugin
-
getDateInstalled
- Specified by:
getDateInstalledin interfacecom.atlassian.plugin.Plugin- Overrides:
getDateInstalledin classcom.atlassian.plugin.impl.AbstractPlugin
-
isUninstallable
public boolean isUninstallable()- Specified by:
isUninstallablein interfacecom.atlassian.plugin.Plugin
-
isDeleteable
public boolean isDeleteable()- Specified by:
isDeleteablein interfacecom.atlassian.plugin.Plugin
-
isDynamicallyLoaded
public boolean isDynamicallyLoaded()- Specified by:
isDynamicallyLoadedin interfacecom.atlassian.plugin.Plugin
-
loadClass
- Specified by:
loadClassin interfacecom.atlassian.plugin.Plugin- Throws:
ClassNotFoundException
-
getResource
- Specified by:
getResourcein interfacecom.atlassian.plugin.Plugin
-
getResourceAsStream
- Specified by:
getResourceAsStreamin interfacecom.atlassian.plugin.Plugin
-
resolve
public void resolve()- Specified by:
resolvein interfacecom.atlassian.plugin.Plugin- Overrides:
resolvein classcom.atlassian.plugin.impl.AbstractPlugin
-
getDependencies
@Nonnull public com.atlassian.plugin.PluginDependencies getDependencies()- Specified by:
getDependenciesin interfacecom.atlassian.plugin.Plugin- Overrides:
getDependenciesin classcom.atlassian.plugin.impl.AbstractPlugin- See Also:
-
Plugin.getDependencies()
-
installInternal
protected void installInternal() throws OsgiContainerException, com.atlassian.plugin.IllegalPluginStateException- Overrides:
installInternalin classcom.atlassian.plugin.impl.AbstractPlugin- Throws:
OsgiContainerExceptioncom.atlassian.plugin.IllegalPluginStateException
-
uninstallInternal
protected void uninstallInternal()- Overrides:
uninstallInternalin classcom.atlassian.plugin.impl.AbstractPlugin
-
enableInternal
protected com.atlassian.plugin.PluginState enableInternal()- Overrides:
enableInternalin classcom.atlassian.plugin.impl.AbstractPlugin
-
disableInternal
protected void disableInternal()- Overrides:
disableInternalin classcom.atlassian.plugin.impl.AbstractPlugin
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event) - Specified by:
bundleChangedin interfaceorg.osgi.framework.BundleListener
-
getContainerAccessor
public com.atlassian.plugin.module.ContainerAccessor getContainerAccessor()- Specified by:
getContainerAccessorin interfacecom.atlassian.plugin.module.ContainerManagedPlugin
-
getClassLoader
- Specified by:
getClassLoaderin interfacecom.atlassian.plugin.Plugin
-