public interface PluginManager
Modifier and Type | Method and Description |
---|---|
Collection<PluginRef> |
getAllPlugins()
Return the complete list of all the plugins currently registered
|
<T> T |
getPlugin(Class<T> pluginClass)
Return an instance of the plugin matching the given type
given type
|
<T> T |
getPlugin(String name)
Return an instance of the plugin that is registered with the given name
|
Collection<Object> |
loadPlugins(PluginSource source)
Load a set of plugin retrieved from the give
PluginSource ,
instantiating the objects, resolving any dependency and registering them
in the context |
<T> void |
register(String name,
T plugin)
Register a plugin in the context with the given name
|
<T> void |
register(T plugin)
Register a plugin in the context
|
<T> T |
removePlugin(String name)
Remove a plugin with the given name from the context
|
<T> T |
removePlugin(T plugin)
Remove a plugin from the context
|
<T> void register(T plugin)
T
- the inferred type of the pluginplugin
- the plugin object to register<T> void register(String name, T plugin)
T
- the inferred type of the pluginname
- the name to associate with the pluginplugin
- the plugin object to register@Nullable <T> T getPlugin(String name)
T
- the inferred type of the pluginname
- the name of the pluginnull
if none exists@Nullable <T> T getPlugin(Class<T> pluginClass)
T
- the inferred type of the pluginpluginClass
- type the plugin must match; can be an interface or superclass. Cannot be null
null
if none existsCollection<PluginRef> getAllPlugins()
Collection
of all the plugins@Nullable <T> T removePlugin(String name)
T
- the inferred type of the pluginname
- the name associated with the pluginnull
if none is exists@Nullable <T> T removePlugin(T plugin)
T
- the inferred type of the pluginplugin
- the plugin instance to removenull
if none is existsCollection<Object> loadPlugins(PluginSource source) throws Exception
PluginSource
,
instantiating the objects, resolving any dependency and registering them
in the contextsource
- the PluginSource
to use for loadingnull
Exception
- an exception that occurred during loading, see PluginSource.load()
Copyright © 2017–2018 PlugFace. All rights reserved.