|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.java.plugin.PluginController
public class PluginController
The plugin Controller provides methods to initialize the plugin framework, load plugin location and access plugins
Constructor Summary | |
---|---|
PluginController(java.lang.ClassLoader pluginsClassLoader,
ObjectFactory objectFactory)
|
Method Summary | |
---|---|
void |
activatePlugin(Plugin plugin)
Activate plugin. |
void |
activatePlugin(PluginDescriptor descriptor)
Activate plugin. |
void |
activatePlugin(java.lang.String id)
Activate plugin. |
void |
addPluginLifecycleListener(PluginLifecycleListener listener)
Adds a PluginLifecycleListener . |
protected void |
configureObjectFactory()
Translates Application configuration to JPF ExtendedProperties before it configures and returns a new ObjectFactory . |
static PluginController |
create()
Create a new PluginController with default configuration |
static PluginController |
create(java.util.Properties config)
Create a new PluginController with a custom runtime configuration |
static PluginController |
create(java.util.Properties config,
java.util.List<? extends com.google.inject.Module> modules)
Create a new PluginController with a custom runtime configuration and a list of Guice Modules used to configure the main Injector . |
java.util.Properties |
getConfiguration()
Returns the current configuration |
PluginManager |
getJPFManager()
|
Plugin |
getPlugin(java.lang.String uniqueID)
Looks for plug-in with given ID and activates it if it is not activated yet. |
java.lang.ClassLoader |
getPluginClassLoader(PluginDescriptor descriptor)
Access the Plugins Classloader |
java.util.List<PluginDescriptor> |
getPluginDescriptions()
Returns a list of all currently available PluginDescriptors |
java.lang.ClassLoader |
getPluginsClassLoader()
Access the global classloader |
void |
initialize(java.util.Properties config)
|
protected void |
integrityCheck()
|
protected java.lang.String |
integrityCheckReport2str(IntegrityCheckReport report)
|
protected void |
loadConfiguration(java.util.Properties config)
Load boot configuration. The configuration defaults are hardcoded here and can easily be overwritten using a resource bundle. |
boolean |
registerLocation(java.io.File... location)
Register a new plugin folder. |
void |
registerPlugins(java.net.URL... pluginURLs)
Register custom plugins. |
void |
removePluginLifecycleListener(PluginLifecycleListener listener)
Removed PluginLifecycleListener . |
void |
shutdown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public PluginController(java.lang.ClassLoader pluginsClassLoader, ObjectFactory objectFactory)
Method Detail |
---|
public void addPluginLifecycleListener(PluginLifecycleListener listener)
PluginLifecycleListener
. Does
nothing when listener was added before
listener
- the listenerPluginLifecycleListener
public void removePluginLifecycleListener(PluginLifecycleListener listener)
PluginLifecycleListener
. Does nothing when
listener was not attached.
listener
- the listenerPluginLifecycleListener
public void initialize(java.util.Properties config)
protected void configureObjectFactory()
ObjectFactory
.
public java.lang.ClassLoader getPluginsClassLoader()
public java.lang.ClassLoader getPluginClassLoader(PluginDescriptor descriptor)
public PluginManager getJPFManager()
public boolean registerLocation(java.io.File... location) throws JpfException
location
- the new location
JpfException
- when an error occures while scanning for pluginspublic void registerPlugins(java.net.URL... pluginURLs) throws JpfException
pluginURLs
- the locations to register
JpfException
- in case registration failspublic void shutdown()
protected void loadConfiguration(java.util.Properties config)
config
- runtime configurationpublic java.util.Properties getConfiguration()
protected void integrityCheck()
protected java.lang.String integrityCheckReport2str(IntegrityCheckReport report)
public Plugin getPlugin(java.lang.String uniqueID) throws PluginLifecycleException
null
.
uniqueID
- unique plugin id
PluginLifecycleException
- if plugin could not be resolvedpublic void activatePlugin(Plugin plugin) throws PluginLifecycleException
plugin
- the plugin to be started
PluginLifecycleException
- if an error occures while the plugin is startedpublic void activatePlugin(PluginDescriptor descriptor) throws PluginLifecycleException
descriptor
- the plugin descriptor
PluginLifecycleException
- if an error occures while the plugin is startedpublic void activatePlugin(java.lang.String id) throws PluginLifecycleException
id
- the plugin to be started
PluginLifecycleException
- if an error occures while the plugin is startedpublic java.util.List<PluginDescriptor> getPluginDescriptions()
PluginDescriptor
public static PluginController create()
public static PluginController create(java.util.Properties config)
config
- the runtime configuration
public static PluginController create(java.util.Properties config, java.util.List<? extends com.google.inject.Module> modules)
Injector
.
config
- the runtime configurationmodules
- a list of modules
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |