Class OsgiBundleFactory
java.lang.Object
com.atlassian.plugin.factories.AbstractPluginFactory
com.atlassian.plugin.osgi.factory.OsgiBundleFactory
- All Implemented Interfaces:
com.atlassian.plugin.factories.PluginFactory
public final class OsgiBundleFactory
extends com.atlassian.plugin.factories.AbstractPluginFactory
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(com.atlassian.plugin.PluginArtifact pluginArtifact) Determines if this deployer can handle this artifact by looking for the plugin descriptorcom.atlassian.plugin.Plugincreate(com.atlassian.plugin.PluginArtifact pluginArtifact, com.atlassian.plugin.ModuleDescriptorFactory moduleDescriptorFactory) Create a plugin from the given artifact.com.atlassian.plugin.ModuleDescriptor<?>createModule(com.atlassian.plugin.Plugin plugin, com.atlassian.plugin.module.Element module, com.atlassian.plugin.ModuleDescriptorFactory moduleDescriptorFactory) protected InputStreamgetDescriptorInputStream(com.atlassian.plugin.PluginArtifact pluginArtifact) Methods inherited from class com.atlassian.plugin.factories.AbstractPluginFactory
getPluginKeyFromDescriptor, hasDescriptor
-
Constructor Details
-
OsgiBundleFactory
-
OsgiBundleFactory
-
-
Method Details
-
getDescriptorInputStream
- Specified by:
getDescriptorInputStreamin classcom.atlassian.plugin.factories.AbstractPluginFactory
-
isValidPluginsVersion
- Specified by:
isValidPluginsVersionin classcom.atlassian.plugin.factories.AbstractPluginFactory
-
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 interfacecom.atlassian.plugin.factories.PluginFactory- Overrides:
canCreatein classcom.atlassian.plugin.factories.AbstractPluginFactory- Parameters:
pluginArtifact- The artifact to test- Returns:
- The plugin key, null if it cannot load the plugin
- Throws:
com.atlassian.plugin.PluginParseException- If there are exceptions parsing the plugin configuration
-
create
public com.atlassian.plugin.Plugin create(com.atlassian.plugin.PluginArtifact pluginArtifact, com.atlassian.plugin.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 com.atlassian.plugin.ModuleDescriptor<?> createModule(com.atlassian.plugin.Plugin plugin, com.atlassian.plugin.module.Element module, com.atlassian.plugin.ModuleDescriptorFactory moduleDescriptorFactory)
-