com.atlassian.plugin.osgi.factory
Class OsgiPluginFactory

java.lang.Object
  extended by com.atlassian.plugin.osgi.factory.OsgiPluginFactory
All Implemented Interfaces:
PluginFactory

public class OsgiPluginFactory
extends Object
implements PluginFactory

Plugin loader that starts an OSGi container and loads plugins into it, wrapped as OSGi bundles. Supports


Nested Class Summary
static class OsgiPluginFactory.DefaultPluginTransformerFactory
           
static interface OsgiPluginFactory.PluginTransformerFactory
           
 
Constructor Summary
OsgiPluginFactory(String pluginDescriptorFileName, Set<String> applicationKeys, OsgiPersistentCache persistentCache, OsgiContainerManager osgi, PluginEventManager pluginEventManager)
          Default constructor
OsgiPluginFactory(String pluginDescriptorFileName, Set<String> applicationKeys, OsgiPersistentCache persistentCache, OsgiContainerManager osgi, PluginEventManager pluginEventManager, OsgiPluginFactory.PluginTransformerFactory pluginTransformerFactory)
          Constructor for implementations that want to override the DefaultPluginTransformer with a custom implementation
OsgiPluginFactory(String pluginDescriptorFileName, String applicationKey, OsgiPersistentCache persistentCache, OsgiContainerManager osgi, PluginEventManager pluginEventManager)
          Deprecated.  
 
Method Summary
 String canCreate(PluginArtifact pluginArtifact)
           
 Plugin create(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)
          Deprecated. Since 2.2.0, use create(PluginArtifact,ModuleDescriptorFactory) instead
 Plugin create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory)
          Deploys the plugin artifact
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiPluginFactory

public OsgiPluginFactory(String pluginDescriptorFileName,
                         String applicationKey,
                         OsgiPersistentCache persistentCache,
                         OsgiContainerManager osgi,
                         PluginEventManager pluginEventManager)
Deprecated. 

Old constructor retained for backwards compatibility


OsgiPluginFactory

public OsgiPluginFactory(String pluginDescriptorFileName,
                         Set<String> applicationKeys,
                         OsgiPersistentCache persistentCache,
                         OsgiContainerManager osgi,
                         PluginEventManager pluginEventManager)
Default constructor


OsgiPluginFactory

public OsgiPluginFactory(String pluginDescriptorFileName,
                         Set<String> applicationKeys,
                         OsgiPersistentCache persistentCache,
                         OsgiContainerManager osgi,
                         PluginEventManager pluginEventManager,
                         OsgiPluginFactory.PluginTransformerFactory pluginTransformerFactory)
Constructor for implementations that want to override the DefaultPluginTransformer with a custom implementation

Method Detail

canCreate

public String canCreate(PluginArtifact pluginArtifact)
                 throws PluginParseException
Specified by:
canCreate in interface PluginFactory
Throws:
PluginParseException

create

public Plugin create(DeploymentUnit deploymentUnit,
                     ModuleDescriptorFactory moduleDescriptorFactory)
              throws PluginParseException
Deprecated. Since 2.2.0, use create(PluginArtifact,ModuleDescriptorFactory) instead

Specified by:
create in interface PluginFactory
Throws:
PluginParseException

create

public Plugin create(PluginArtifact pluginArtifact,
                     ModuleDescriptorFactory moduleDescriptorFactory)
              throws PluginParseException
Deploys the plugin artifact

Specified by:
create in interface PluginFactory
Parameters:
pluginArtifact - the plugin artifact to deploy
moduleDescriptorFactory - The factory for plugin modules
Returns:
The instantiated and populated plugin
Throws:
PluginParseException - If the descriptor cannot be parsed
IllegalArgumentException - If the plugin descriptor isn't found, and the plugin key and bundle version aren't specified in the manifest
Since:
2.2.0


Copyright © 2012 Atlassian. All Rights Reserved.