com.atlassian.plugin.osgi.loader
Class OsgiPluginLoader

java.lang.Object
  extended by com.atlassian.plugin.loaders.ClassLoadingPluginLoader
      extended by com.atlassian.plugin.osgi.loader.OsgiPluginLoader
All Implemented Interfaces:
PluginLoader

public class OsgiPluginLoader
extends ClassLoadingPluginLoader

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


Constructor Summary
OsgiPluginLoader(java.io.File pluginPath, java.io.File startBundlesPath, java.lang.String pluginDescriptorFileName, PluginFactory pluginFactory, HostComponentProvider provider)
           
 
Method Summary
protected  Plugin createPlugin(DescriptorParser parser, DeploymentUnit unit, PluginClassLoader loader)
           
protected  Plugin handleNoDescriptor(DeploymentUnit deploymentUnit)
           
 java.util.Collection loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
           
 void reloadHostComponents(HostComponentProvider provider)
          Forces all registered host components to be unregistered and the HostComponentProvider to be called to get a new list of host components
 void setJarPatterns(java.util.List<java.lang.String> includes, java.util.List<java.lang.String> excludes)
          Sets the jars to include and exclude from scanning
 void setPackagePatterns(java.util.List<java.lang.String> includes, java.util.List<java.lang.String> excludes)
          Sets the packages to include and exclude
 void setPackageVersions(java.util.Map<java.lang.String,java.lang.String> packageToVersions)
          Maps discovered packages to specific versions by overriding autodiscovered versions
 void setPluginTransformer(PluginTransformer trans)
           
 void shutDown()
           
 
Methods inherited from class com.atlassian.plugin.loaders.ClassLoadingPluginLoader
addFoundPlugins, deployPluginFromUnit, removePlugin, supportsAddition, supportsRemoval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiPluginLoader

public OsgiPluginLoader(java.io.File pluginPath,
                        java.io.File startBundlesPath,
                        java.lang.String pluginDescriptorFileName,
                        PluginFactory pluginFactory,
                        HostComponentProvider provider)
Method Detail

setPluginTransformer

public void setPluginTransformer(PluginTransformer trans)

reloadHostComponents

public void reloadHostComponents(HostComponentProvider provider)
Forces all registered host components to be unregistered and the HostComponentProvider to be called to get a new list of host components

Parameters:
provider - The host component provider to reload from

shutDown

public void shutDown()
Overrides:
shutDown in class ClassLoadingPluginLoader

loadAllPlugins

public java.util.Collection loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
Specified by:
loadAllPlugins in interface PluginLoader
Overrides:
loadAllPlugins in class ClassLoadingPluginLoader

createPlugin

protected Plugin createPlugin(DescriptorParser parser,
                              DeploymentUnit unit,
                              PluginClassLoader loader)
Overrides:
createPlugin in class ClassLoadingPluginLoader

handleNoDescriptor

protected Plugin handleNoDescriptor(DeploymentUnit deploymentUnit)
                             throws PluginParseException
Overrides:
handleNoDescriptor in class ClassLoadingPluginLoader
Throws:
PluginParseException

setJarPatterns

public void setJarPatterns(java.util.List<java.lang.String> includes,
                           java.util.List<java.lang.String> excludes)
Sets the jars to include and exclude from scanning

Parameters:
includes - A list of jar patterns to include
excludes - A list of jar patterns to exclude

setPackagePatterns

public void setPackagePatterns(java.util.List<java.lang.String> includes,
                               java.util.List<java.lang.String> excludes)
Sets the packages to include and exclude

Parameters:
includes - A list of patterns to include
excludes - A list of patterns to exclude

setPackageVersions

public void setPackageVersions(java.util.Map<java.lang.String,java.lang.String> packageToVersions)
Maps discovered packages to specific versions by overriding autodiscovered versions

Parameters:
packageToVersions - A map of package patterns to version strings


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.