Class OsgiBundlePlugin
- All Implemented Interfaces:
ContainerManagedPlugin,OsgiBackedPlugin,Plugin,PluginInternal,Resourced,ScopeAware,Comparable<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
pluginArtifact -
Constructor Summary
ConstructorsConstructorDescriptionOsgiBundlePlugin(OsgiContainerManager osgiContainerManager, String pluginKey, 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 PluginStateorg.osgi.framework.BundleReturnsOSGi Bundlethat corresponds to the current plugingetResource(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, 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 interfacePlugin- Overrides:
getDateLoadedin classAbstractPlugin
-
getDateInstalled
- Specified by:
getDateInstalledin interfacePlugin- Overrides:
getDateInstalledin classAbstractPlugin
-
isUninstallable
public boolean isUninstallable()- Specified by:
isUninstallablein interfacePlugin
-
isDeleteable
public boolean isDeleteable()- Specified by:
isDeleteablein interfacePlugin
-
isDynamicallyLoaded
public boolean isDynamicallyLoaded()- Specified by:
isDynamicallyLoadedin interfacePlugin
-
loadClass
- Specified by:
loadClassin interfacePlugin- Throws:
ClassNotFoundException
-
getResource
- Specified by:
getResourcein interfacePlugin
-
getResourceAsStream
- Specified by:
getResourceAsStreamin interfacePlugin
-
resolve
public void resolve()- Specified by:
resolvein interfacePlugin- Overrides:
resolvein classAbstractPlugin
-
getDependencies
- Specified by:
getDependenciesin interfacePlugin- Overrides:
getDependenciesin classAbstractPlugin- See Also:
-
installInternal
- Overrides:
installInternalin classAbstractPlugin- Throws:
OsgiContainerExceptionIllegalPluginStateException
-
uninstallInternal
protected void uninstallInternal()- Overrides:
uninstallInternalin classAbstractPlugin
-
enableInternal
- Overrides:
enableInternalin classAbstractPlugin
-
disableInternal
protected void disableInternal()- Overrides:
disableInternalin classAbstractPlugin
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event) - Specified by:
bundleChangedin interfaceorg.osgi.framework.BundleListener
-
getContainerAccessor
- Specified by:
getContainerAccessorin interfaceContainerManagedPlugin
-
getClassLoader
- Specified by:
getClassLoaderin interfacePlugin
-