public class

PluginsConfigurationBuilder

extends Object
java.lang.Object
   ↳ com.atlassian.plugin.main.PluginsConfigurationBuilder

Class Overview

The builder for PluginsConfiguration instances that additionally performs validation and default creation. For a usage example, see the package javadocs.

Not thread-safe. Instances of this class should be thread and preferably method local.

Summary

Public Constructors
PluginsConfigurationBuilder()
Public Methods
PluginsConfigurationBuilder applicationKey(String applicationKey)
Sets the current application key to use when filtering modules in a plugin
PluginsConfiguration build()
Builds a PluginsConfiguration instance by processing the configuration that was previously set, validating the input, and setting any defaults where not explicitly specified.
PluginsConfigurationBuilder bundledPluginCacheDirectory(File bundledPluginCacheDirectory)
Sets the directory to unzip bundled plugins into.
PluginsConfigurationBuilder bundledPluginUrl(URL bundledPluginUrl)
Sets the URL to a ZIP file containing plugins that are to be started before any user plugins but after framework bundles.
PluginsConfigurationBuilder hostComponentProvider(HostComponentProvider hostComponentProvider)
Sets the host component provider instance, used for registering application services as OSGi services so that they can be automatically available to plugins
PluginsConfigurationBuilder hotDeployPollingFrequency(long hotDeployPollingFrequency, TimeUnit timeUnit)
Sets the polling frequency for scanning for new plugins
PluginsConfigurationBuilder moduleDescriptorFactory(ModuleDescriptorFactory moduleDescriptorFactory)
Sets the module descriptor factory that will be used to create instances of discovered module descriptors.
PluginsConfigurationBuilder osgiPersistentCache(File osgiPersistentCache)
Sets the set of persistent caching directories the OSGi classes will use.
PluginsConfigurationBuilder packageScannerConfiguration(PackageScannerConfiguration packageScannerConfiguration)
Sets the package scanner configuration instance that contains information about what packages to expose to plugins.
PluginsConfigurationBuilder pluginDescriptorFilename(String pluginDescriptorFilename)
Sets the plugin descriptor file name to expect in a plugin JAR artifact
PluginsConfigurationBuilder pluginDirectory(File pluginDirectory)
Sets the directory that contains the plugins and will be used to store installed plugins.
PluginsConfigurationBuilder pluginStateStore(PluginPersistentStateStore pluginStateStore)
Sets the plugin state store implementation used for persisting which plugins and modules are enabled or disabled across restarts.
static PluginsConfigurationBuilder pluginsConfiguration()
Static factory for creating a new builder.
PluginsConfigurationBuilder useLegacyDynamicPluginDeployer(boolean useLegacyDynamicPluginDeployer)
Defines whether ther legacy plugin deployer should be used or not.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PluginsConfigurationBuilder ()

Public Methods

public PluginsConfigurationBuilder applicationKey (String applicationKey)

Sets the current application key to use when filtering modules in a plugin

Parameters
applicationKey the current application identifier
Returns
  • this

public PluginsConfiguration build ()

Builds a PluginsConfiguration instance by processing the configuration that was previously set, validating the input, and setting any defaults where not explicitly specified.

Returns

public PluginsConfigurationBuilder bundledPluginCacheDirectory (File bundledPluginCacheDirectory)

Sets the directory to unzip bundled plugins into. The directory will automatically be cleaned out if the framework detects any modification. Must be set if bundledPluginUrl(java.net.URL) is set.

Parameters
bundledPluginCacheDirectory A directory that exists
Returns
  • this

public PluginsConfigurationBuilder bundledPluginUrl (URL bundledPluginUrl)

Sets the URL to a ZIP file containing plugins that are to be started before any user plugins but after framework bundles. Must be set if bundledPluginCacheDirectory(java.io.File) is set.

Parameters
bundledPluginUrl A URL to a ZIP of plugin JAR files
Returns
  • this

public PluginsConfigurationBuilder hostComponentProvider (HostComponentProvider hostComponentProvider)

Sets the host component provider instance, used for registering application services as OSGi services so that they can be automatically available to plugins

Parameters
hostComponentProvider The host component provider implementation
Returns
  • this

public PluginsConfigurationBuilder hotDeployPollingFrequency (long hotDeployPollingFrequency, TimeUnit timeUnit)

Sets the polling frequency for scanning for new plugins

Parameters
hotDeployPollingFrequency The quantity of time periods
timeUnit The units for the frequency
Returns
  • this

public PluginsConfigurationBuilder moduleDescriptorFactory (ModuleDescriptorFactory moduleDescriptorFactory)

Sets the module descriptor factory that will be used to create instances of discovered module descriptors. Usually, the DefaultModuleDescriptorFactory is what is used, which takes class instances of module descriptors to instantiate.

Parameters
moduleDescriptorFactory A module descriptor factory instance
Returns
  • this

public PluginsConfigurationBuilder osgiPersistentCache (File osgiPersistentCache)

Sets the set of persistent caching directories the OSGi classes will use. This includes the caching directory to extract framework bundles into, the container bundle cache, and the transformed plugin cache.

Parameters
osgiPersistentCache A directory that exists
Returns
  • this

public PluginsConfigurationBuilder packageScannerConfiguration (PackageScannerConfiguration packageScannerConfiguration)

Sets the package scanner configuration instance that contains information about what packages to expose to plugins.

Parameters
packageScannerConfiguration The configuration instance
Returns
  • this

public PluginsConfigurationBuilder pluginDescriptorFilename (String pluginDescriptorFilename)

Sets the plugin descriptor file name to expect in a plugin JAR artifact

Parameters
pluginDescriptorFilename A valid file name
Returns
  • this

public PluginsConfigurationBuilder pluginDirectory (File pluginDirectory)

Sets the directory that contains the plugins and will be used to store installed plugins.

Parameters
pluginDirectory A directory that exists
Returns
  • this

public PluginsConfigurationBuilder pluginStateStore (PluginPersistentStateStore pluginStateStore)

Sets the plugin state store implementation used for persisting which plugins and modules are enabled or disabled across restarts.

Parameters
pluginStateStore The plugin state store implementation
Returns
  • this

public static PluginsConfigurationBuilder pluginsConfiguration ()

Static factory for creating a new builder.

Returns
  • a new builder.

public PluginsConfigurationBuilder useLegacyDynamicPluginDeployer (boolean useLegacyDynamicPluginDeployer)

Defines whether ther legacy plugin deployer should be used or not.

Parameters
useLegacyDynamicPluginDeployer true if the legacy plugin deployer should be used.
Returns
  • this