com.mycila.plugin.api
Interface PluginLoader<T extends Plugin>


public interface PluginLoader<T extends Plugin>

The PluginLoader is responsible of loading all plugins found. Default implementation is from the filesystem, but is could be from other locations

Author:
Mathieu Carbou (mathieu.carbou@gmail.com)

Method Summary
 java.util.Set<PluginBinding<T>> loadPlugins()
          Load (and reload for subsequent calls) all the available plugins
 void setExclusions(java.util.Collection<java.lang.String> exclusions)
          Set which plugin names should not be loaded
 void setExclusions(java.lang.String... exclusions)
          Set which plugin names should not be loaded
 void setLoader(java.lang.ClassLoader loader)
          Set which classloader should be used to instanciate plugin classes.
 

Method Detail

loadPlugins

java.util.Set<PluginBinding<T>> loadPlugins()
Load (and reload for subsequent calls) all the available plugins

Returns:
a map of plugins by their name, or an empty map
Throws:
DuplicatePluginException - If a plugin has been found twice
PluginCreationException - If a plugin cannot be created (i.e. bad plugin class)
PluginIOException - If errors occured while IO operations

setExclusions

void setExclusions(java.lang.String... exclusions)
Set which plugin names should not be loaded

Parameters:
exclusions - An array of plugin names

setExclusions

void setExclusions(java.util.Collection<java.lang.String> exclusions)
Set which plugin names should not be loaded

Parameters:
exclusions - A collection of plugin names

setLoader

void setLoader(java.lang.ClassLoader loader)
Set which classloader should be used to instanciate plugin classes. Usefull to isolate classloaders and plugins.

Parameters:
loader - ClassLoader to use


Copyright © 2008-2010 Mycila. All Rights Reserved.