Class OsgiBundleFactory
java.lang.Object
com.atlassian.plugin.factories.AbstractPluginFactory
com.atlassian.plugin.osgi.factory.OsgiBundleFactory
- All Implemented Interfaces:
PluginFactory
Plugin deployer that deploys OSGi bundles that don't contain a (spring) context instantiated by the
plugin system
-
Field Summary
Fields inherited from class com.atlassian.plugin.factories.AbstractPluginFactory
applications, descriptorParserFactory -
Constructor Summary
ConstructorsConstructorDescriptionOsgiBundleFactory(String pluginDescriptorFileName, OsgiContainerManager osgi) -
Method Summary
Modifier and TypeMethodDescriptioncanCreate(PluginArtifact pluginArtifact) Determines if this deployer can handle this artifact by looking for the plugin descriptorcreate(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory) Create a plugin from the given 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
-
OsgiBundleFactory
-
OsgiBundleFactory
-
-
Method Details
-
getDescriptorInputStream
- Specified by:
getDescriptorInputStreamin classAbstractPluginFactory
-
isValidPluginsVersion
- Specified by:
isValidPluginsVersionin classAbstractPluginFactory
-
canCreate
Determines if this deployer can handle this artifact by looking for the plugin descriptorOsgiBundlePlugin wraps usual OSGi Bundle into Atlassian Plugin. Factory could create plugin for any bundle that is not Spring powered even for those has not atlassian-plugin.xml. Note that some parts of plugin descriptor, such as <component> or <component-import>, relies on IoC container in order to work, so without PluginContainerAccessor service exported it won't work and will throw an exception
- Specified by:
canCreatein interfacePluginFactory- Overrides:
canCreatein classAbstractPluginFactory- Parameters:
pluginArtifact- The artifact to test- Returns:
- The plugin key, null if it cannot load the plugin
- Throws:
PluginParseException- If there are exceptions parsing the plugin configuration
-
create
public Plugin create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory) Create a plugin from the given artifact.- Parameters:
pluginArtifact- the plugin artifact containing the plugin.moduleDescriptorFactory- The factory for plugin modules.- Returns:
- The instantiated and populated plugin, or an
UnloadablePluginif the plugin cannot be loaded. - Since:
- 2.2.0
-
createModule
public ModuleDescriptor<?> createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory)
-