Package step.core.plugins
Class PluginManager<T extends AbstractPlugin>
- java.lang.Object
-
- step.core.plugins.PluginManager<T>
-
- All Implemented Interfaces:
InvocationHandler
public class PluginManager<T extends AbstractPlugin> extends Object implements InvocationHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPluginManager.CircularDependencyException
-
Constructor Summary
Constructors Constructor Description PluginManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <CALLBACK extends PluginCallbacks>
CALLBACKgetProxy(Class<CALLBACK> interfaceClass)voidinitialize()Objectinvoke(Object proxy, Method method, Object[] args)voidregister(T plugin)protected List<T>sortPluginsByDependencies(List<T> plugins)Sort the plugins according to their mutual dependencies.
-
-
-
Field Detail
-
plugins
protected List<T extends AbstractPlugin> plugins
-
-
Method Detail
-
getProxy
public <CALLBACK extends PluginCallbacks> CALLBACK getProxy(Class<CALLBACK> interfaceClass)
-
sortPluginsByDependencies
protected List<T> sortPluginsByDependencies(List<T> plugins) throws PluginManager.CircularDependencyException
Sort the plugins according to their mutual dependencies. The plugin with the highest dependency to other plugins will be located at the end of the list.- Parameters:
plugins- the unsorted list of plugins- Returns:
- the sorted list of plugins
- Throws:
PluginManager.CircularDependencyException- if a circular dependency is detected
-
register
public void register(T plugin)
-
-