com.atlassian.plugin.factories
Class AbstractPluginFactory
java.lang.Object
com.atlassian.plugin.factories.AbstractPluginFactory
- All Implemented Interfaces:
- PluginFactory
- Direct Known Subclasses:
- LegacyDynamicPluginFactory, OsgiBundleFactory, OsgiPluginFactory, RemotablePluginFactory, UnloadableStaticPluginFactory, XmlDynamicPluginFactory
public abstract class AbstractPluginFactory
- extends Object
- implements PluginFactory
- Since:
- 3.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
descriptorParserFactory
protected final DescriptorParserFactory descriptorParserFactory
applications
protected final Set<Application> applications
AbstractPluginFactory
protected AbstractPluginFactory(DescriptorParserFactory descriptorParserFactory,
Set<Application> applications)
canCreate
public String canCreate(PluginArtifact pluginArtifact)
throws PluginParseException
- Determines if this deployer can handle this artifact by looking for the plugin descriptor
- Specified by:
canCreate in interface PluginFactory
- 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
@Deprecated
public final Plugin create(DeploymentUnit deploymentUnit,
ModuleDescriptorFactory moduleDescriptorFactory)
throws PluginParseException
- Deprecated. Since 2.2.0, use
PluginFactory.create(com.atlassian.plugin.PluginArtifact, com.atlassian.plugin.ModuleDescriptorFactory) instead
- Description copied from interface:
PluginFactory
- Deploys the deployment unit by instantiating the plugin and configuring it. Should only be called if the respective
PluginFactory.canCreate(PluginArtifact) call returned the plugin key
- Specified by:
create in interface PluginFactory
- Parameters:
deploymentUnit - the unit to deploymoduleDescriptorFactory - the factory for the module descriptors
- Returns:
- the plugin loaded from the deployment unit, or an UnloadablePlugin instance if loading fails.
- Throws:
PluginParseException - if the plugin could not be parsed
hasDescriptor
protected final boolean hasDescriptor(PluginArtifact pluginArtifact)
getPluginKeyFromDescriptor
protected final String getPluginKeyFromDescriptor(PluginArtifact pluginArtifact)
getDescriptorInputStream
protected abstract InputStream getDescriptorInputStream(PluginArtifact pluginArtifact)
isValidPluginsVersion
protected abstract com.google.common.base.Predicate<Integer> isValidPluginsVersion()
Copyright © 2015 Atlassian. All rights reserved.