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 java.lang.Object
implements PluginFactory

Since:
3.0

Field Summary
protected  java.util.Set<Application> applications
           
protected  DescriptorParserFactory descriptorParserFactory
           
protected  org.slf4j.Logger log
           
 
Constructor Summary
protected AbstractPluginFactory(DescriptorParserFactory descriptorParserFactory, java.util.Set<Application> applications)
           
 
Method Summary
 java.lang.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  java.io.InputStream getDescriptorInputStream(PluginArtifact pluginArtifact)
           
protected  java.lang.String getPluginKeyFromDescriptor(PluginArtifact pluginArtifact)
           
protected  boolean hasDescriptor(PluginArtifact pluginArtifact)
           
protected abstract  com.google.common.base.Predicate<java.lang.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

log

protected final org.slf4j.Logger log

descriptorParserFactory

protected final DescriptorParserFactory descriptorParserFactory

applications

protected final java.util.Set<Application> applications
Constructor Detail

AbstractPluginFactory

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

canCreate

public java.lang.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 java.lang.String getPluginKeyFromDescriptor(PluginArtifact pluginArtifact)

getDescriptorInputStream

protected abstract java.io.InputStream getDescriptorInputStream(PluginArtifact pluginArtifact)

isValidPluginsVersion

protected abstract com.google.common.base.Predicate<java.lang.Integer> isValidPluginsVersion()


Copyright © 2013 Atlassian. All Rights Reserved.