com.atlassian.plugin.factories
Class AbstractPluginFactory

java.lang.Object
  extended by 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

Field Summary
protected  Set<Application> applications
           
protected  DescriptorParserFactory descriptorParserFactory
           
 
Constructor Summary
protected AbstractPluginFactory(DescriptorParserFactory descriptorParserFactory, Set<Application> applications)
           
 
Method Summary
 String canCreate(PluginArtifact pluginArtifact)
          Determines if this deployer can handle this artifact by looking for the plugin descriptor
 Plugin create(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)
          Deprecated. Since 2.2.0, use PluginFactory.create(com.atlassian.plugin.PluginArtifact, com.atlassian.plugin.ModuleDescriptorFactory) instead
protected abstract  InputStream getDescriptorInputStream(PluginArtifact pluginArtifact)
           
protected  String getPluginKeyFromDescriptor(PluginArtifact pluginArtifact)
           
protected  boolean hasDescriptor(PluginArtifact pluginArtifact)
           
protected abstract  com.google.common.base.Predicate<Integer> isValidPluginsVersion()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.plugin.factories.PluginFactory
create
 

Field Detail

descriptorParserFactory

protected final DescriptorParserFactory descriptorParserFactory

applications

protected final Set<Application> applications
Constructor Detail

AbstractPluginFactory

protected AbstractPluginFactory(DescriptorParserFactory descriptorParserFactory,
                                Set<Application> applications)
Method Detail

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 deploy
moduleDescriptorFactory - 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.