public class OsgiBundlePlugin extends AbstractPlugin implements OsgiBackedPlugin, ContainerManagedPlugin, 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 underlaying OSGi Bundle natural statesPlugin.EnabledMetricsSource, Plugin.ResolvablePlugin.EnabledMetricsSource.DefaultpluginArtifactNAME_COMPARATOR, VERSION_1, VERSION_2, VERSION_3| Constructor and Description |
|---|
OsgiBundlePlugin(org.osgi.framework.Bundle bundle,
String pluginKey,
PluginArtifact pluginArtifact)
Deprecated.
since 3.0.23, use
OsgiBundlePlugin(OsgiContainerManager, String, PluginArtifact) |
OsgiBundlePlugin(OsgiContainerManager osgiContainerManager,
String pluginKey,
PluginArtifact pluginArtifact)
Create a plugin wrapper which installs the bundle when the plugin is installed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bundleChanged(org.osgi.framework.BundleEvent event) |
protected void |
disableInternal() |
protected PluginState |
enableInternal() |
org.osgi.framework.Bundle |
getBundle()
Returns
OSGi Bundle that corresponds to the current plugin |
ClassLoader |
getClassLoader() |
ContainerAccessor |
getContainerAccessor() |
Date |
getDateInstalled() |
Date |
getDateLoaded() |
PluginDependencies |
getDependencies() |
URL |
getResource(String name) |
InputStream |
getResourceAsStream(String name) |
protected void |
installInternal() |
boolean |
isDeleteable() |
boolean |
isDynamicallyLoaded() |
boolean |
isUninstallable() |
<T> Class<T> |
loadClass(String clazz,
Class<?> callingClass) |
void |
resolve() |
protected void |
uninstallInternal() |
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, getResourceDescriptors, getResourceLocation, getScopeKey, hasAllPermissions, install, isBundledPlugin, isEnabled, isEnabledByDefault, isSystemPlugin, removeDynamicModuleDescriptor, removeModuleDescriptor, setBundledPlugin, setEnabled, setEnabledByDefault, setI18nNameKey, setKey, setName, setPluginInformation, setPluginState, setPluginsVersion, setResources, setSystemPlugin, toString, uninstallclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddModuleDescriptor, close, containsSystemModule, disable, enable, getActivePermissions, getDateEnabled, getDateEnabling, getI18nNameKey, getInstallationMode, getKey, getModuleDescriptor, getModuleDescriptors, getModuleDescriptorsByModuleClass, getName, getPluginArtifact, getPluginInformation, getPluginState, getPluginsVersion, getRequiredPlugins, hasAllPermissions, install, isBundledPlugin, isEnabled, isEnabledByDefault, isSystemPlugin, setEnabled, setEnabledByDefault, setI18nNameKey, setKey, setName, setPluginInformation, setPluginsVersion, setResources, setSystemPlugin, uninstallgetScopeKeygetResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocationcompareTo@Deprecated public OsgiBundlePlugin(org.osgi.framework.Bundle bundle, String pluginKey, PluginArtifact pluginArtifact)
OsgiBundlePlugin(OsgiContainerManager, String, PluginArtifact)bundle - The installed Bundle.pluginKey - The plugin key.pluginArtifact - The plugin artifact that was installed.public OsgiBundlePlugin(OsgiContainerManager osgiContainerManager, String pluginKey, PluginArtifact pluginArtifact)
osgiContainerManager - the container to install into when the plugin is installed.pluginKey - The plugin key.pluginArtifact - The The plugin artifact to install.public org.osgi.framework.Bundle getBundle()
throws IllegalPluginStateException
OsgiBackedPluginOSGi Bundle that corresponds to the current plugin
Note that Bundle could be not available on some of Plugin lifecycle
stages. In that case method call results in IllegalPluginStateException
getBundle in interface OsgiBackedPluginOSGi representation of the current pluginIllegalPluginStateException - if plugin has no OSGi representation yetpublic Date getDateLoaded()
getDateLoaded in interface PlugingetDateLoaded in class AbstractPluginpublic Date getDateInstalled()
getDateInstalled in interface PlugingetDateInstalled in class AbstractPluginpublic boolean isUninstallable()
isUninstallable in interface Pluginpublic boolean isDeleteable()
isDeleteable in interface Pluginpublic boolean isDynamicallyLoaded()
isDynamicallyLoaded in interface Pluginpublic <T> Class<T> loadClass(String clazz, Class<?> callingClass) throws ClassNotFoundException
loadClass in interface PluginClassNotFoundExceptionpublic URL getResource(String name)
getResource in interface Pluginpublic InputStream getResourceAsStream(String name)
getResourceAsStream in interface Pluginpublic void resolve()
resolve in interface Pluginresolve in class AbstractPlugin@Nonnull public PluginDependencies getDependencies()
getDependencies in interface PlugingetDependencies in class AbstractPluginPlugin.getDependencies()protected void installInternal()
throws OsgiContainerException,
IllegalPluginStateException
installInternal in class AbstractPluginOsgiContainerExceptionIllegalPluginStateExceptionprotected void uninstallInternal()
uninstallInternal in class AbstractPluginprotected PluginState enableInternal()
enableInternal in class AbstractPluginprotected void disableInternal()
disableInternal in class AbstractPluginpublic void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged in interface org.osgi.framework.BundleListenerpublic ContainerAccessor getContainerAccessor()
getContainerAccessor in interface ContainerManagedPluginpublic ClassLoader getClassLoader()
getClassLoader in interface PluginCopyright © 2018 Atlassian. All rights reserved.