hudson
Interface PluginStrategy

All Superinterfaces:
ExtensionPoint
All Known Implementing Classes:
ClassicPluginStrategy

public interface PluginStrategy
extends ExtensionPoint

Pluggability point for how to create PluginWrapper.

This extension point was added to allow plugins to be loaded into a different environment (such as loading it in an existing DI container like Plexus.) A plugin strategy is a singleton instance, and as such this feature is primarily meant for OEM. See PluginManager.createPluginStrategy() for how this instance is created.


Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Method Summary
 PluginWrapper createPluginWrapper(File archive)
          Creates a plugin wrapper, which provides a management interface for the plugin
<T> List<ExtensionComponent<T>>
findComponents(Class<T> type, Hudson hudson)
          Find components of the given type using the assigned strategy.
 void initializeComponents(PluginWrapper plugin)
          Optionally start services provided by the plugin.
 void load(PluginWrapper wrapper)
          Loads the plugin and starts it.
 

Method Detail

createPluginWrapper

PluginWrapper createPluginWrapper(File archive)
                                  throws IOException
Creates a plugin wrapper, which provides a management interface for the plugin

Parameters:
archive - Either a directory that points to a pre-exploded plugin, or an hpi file, or an hpl file.
Throws:
IOException

load

void load(PluginWrapper wrapper)
          throws IOException
Loads the plugin and starts it.

This should be done after all the classloaders are constructed for all the plugins, so that dependencies can be properly loaded by plugins.

Throws:
IOException

initializeComponents

void initializeComponents(PluginWrapper plugin)
Optionally start services provided by the plugin. Should be called when all plugins are loaded.

Parameters:
plugin -

findComponents

<T> List<ExtensionComponent<T>> findComponents(Class<T> type,
                                               Hudson hudson)
Find components of the given type using the assigned strategy.

Parameters:
type - The component type
hudson - The Hudson scope
Returns:
Sequence of components
Since:
1.397


Copyright © 2004-2013 Hudson. All Rights Reserved.