Package org.drasyl.plugins
Class PluginManager
- java.lang.Object
-
- org.drasyl.plugins.PluginManager
-
- All Implemented Interfaces:
AutoCloseable
,DrasylNodeComponent
public class PluginManager extends Object implements DrasylNodeComponent
-
-
Constructor Summary
Constructors Constructor Description PluginManager(Pipeline pipeline, DrasylConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(DrasylPlugin plugin)
void
close()
Stops all plugins and removes them from the plugin list.void
open()
Automatically loads all plugins that are defined in the correspondingDrasylConfig
.void
remove(String name)
-
-
-
Constructor Detail
-
PluginManager
public PluginManager(Pipeline pipeline, DrasylConfig config)
-
-
Method Detail
-
open
public void open() throws DrasylException
Automatically loads all plugins that are defined in the correspondingDrasylConfig
.- Specified by:
open
in interfaceDrasylNodeComponent
- Throws:
DrasylException
- if error occurs during opening
-
close
public void close()
Stops all plugins and removes them from the plugin list.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDrasylNodeComponent
-
add
public void add(DrasylPlugin plugin)
- Parameters:
plugin
- the plugin that should be added
-
remove
public void remove(String name)
- Parameters:
name
- the plugin that should be removed
-
-