Class OsgiPluginFactory
java.lang.Object
com.atlassian.plugin.factories.AbstractPluginFactory
com.atlassian.plugin.osgi.factory.OsgiPluginFactory
- All Implemented Interfaces:
PluginFactory
Plugin loader that starts an OSGi container and loads plugins into it, wrapped as OSGi bundles. Supports
- Dynamic loading of module descriptors via OSGi services
- Delayed enabling until the plugin container is active
- XML or Jar manifest configuration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Field Summary
Fields inherited from class com.atlassian.plugin.factories.AbstractPluginFactory
descriptorParserFactory -
Constructor Summary
ConstructorsConstructorDescriptionOsgiPluginFactory(String pluginDescriptorFileName, Set<Application> applications, OsgiPersistentCache persistentCache, OsgiContainerManager osgi, com.atlassian.plugin.event.PluginEventManager pluginEventManager) Default constructorOsgiPluginFactory(String pluginDescriptorFileName, Set<Application> applications, OsgiPersistentCache persistentCache, OsgiContainerManager osgi, com.atlassian.plugin.event.PluginEventManager pluginEventManager, OsgiPluginFactory.PluginTransformerFactory pluginTransformerFactory) Constructor for implementations that want to override the DefaultPluginTransformer with a custom implementation -
Method Summary
Modifier and TypeMethodDescriptioncanCreate(PluginArtifact pluginArtifact) create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory) Deploys the plugin artifact.createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory) protected InputStreamgetDescriptorInputStream(PluginArtifact pluginArtifact) Methods inherited from class com.atlassian.plugin.factories.AbstractPluginFactory
getPluginKeyFromDescriptor, hasDescriptor
-
Constructor Details
-
OsgiPluginFactory
public OsgiPluginFactory(String pluginDescriptorFileName, Set<Application> applications, OsgiPersistentCache persistentCache, OsgiContainerManager osgi, com.atlassian.plugin.event.PluginEventManager pluginEventManager) Default constructor -
OsgiPluginFactory
public OsgiPluginFactory(String pluginDescriptorFileName, Set<Application> applications, OsgiPersistentCache persistentCache, OsgiContainerManager osgi, com.atlassian.plugin.event.PluginEventManager pluginEventManager, OsgiPluginFactory.PluginTransformerFactory pluginTransformerFactory) Constructor for implementations that want to override the DefaultPluginTransformer with a custom implementation
-
-
Method Details
-
canCreate
- Specified by:
canCreatein interfacePluginFactory- Overrides:
canCreatein classAbstractPluginFactory
-
getDescriptorInputStream
- Specified by:
getDescriptorInputStreamin classAbstractPluginFactory
-
isValidPluginsVersion
- Specified by:
isValidPluginsVersionin classAbstractPluginFactory
-
create
public Plugin create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory) Deploys the plugin artifact. The artifact will only undergo transformation if a plugin descriptor can be found and the "Atlassian-Plugin-Key" value is not already defined in the manifest.- Parameters:
pluginArtifact- the plugin artifact to deploymoduleDescriptorFactory- The factory for plugin modules- Returns:
- The instantiated and populated plugin
- Throws:
PluginParseException- If the descriptor cannot be parsedIllegalArgumentException- If the plugin descriptor isn't found, and the plugin key and bundle version aren't specified in the manifest- Since:
- 2.2.0
-
createModule
public ModuleDescriptor<?> createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory)
-