public class WPPluginManager
extends java.lang.Object
Plugin
s.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DESCRIPTOR_PATH
The resource filename in which WorldPainter plugin descriptors are stored.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Plugin> |
getAllPlugins()
Get a list of all loaded WorldPainter plugins.
|
static WPPluginManager |
getInstance()
Obtain the single instance of the WorldPainter plugin manager.
|
<T extends Plugin> |
getPlugins(java.lang.Class<T> type)
Get a list of all loaded WorldPainter plugins which implement a
particular type.
|
static void |
initialise(java.util.UUID uuid)
Initialise the WorldPainter plugin manager for a particular WorldPainter installation.
|
static void |
initialise(java.util.UUID uuid,
java.lang.ClassLoader classLoader)
Initialise the WorldPainter plugin manager for a particular WorldPainter installation.
|
public static final java.lang.String DESCRIPTOR_PATH
filename
parameter of the PluginManager.loadPlugins(File, PublicKey, String, Version, boolean)
method.public java.util.List<Plugin> getAllPlugins()
public <T extends Plugin> java.util.List<T> getPlugins(java.lang.Class<T> type)
T
- The type of plugin to return.type
- The type of plugin to return.public static void initialise(java.util.UUID uuid)
initialise(UUID, ClassLoader)
should be invoked only once, before getInstance()
is invoked.
Please note! If plugins should be loaded from plugin jars,
PluginManager.loadPlugins(File, PublicKey, String, Version, boolean)
must be invoked before this
method, to ensure the jars are discovered.
uuid
- The unique identifier of the WorldPainter installation for which to initialise the WorldPainter
plugin manager.public static void initialise(java.util.UUID uuid, java.lang.ClassLoader classLoader)
initialise(UUID)
should be invoked only once, before getInstance()
is invoked.
Please note! If plugins should be loaded from plugin jars,
PluginManager.loadPlugins(File, PublicKey, String, Version, boolean)
must be invoked before this
method, to ensure the jars are discovered.
uuid
- The unique identifier of the WorldPainter installation for which to initialise the WorldPainter
plugin manager.classLoader
- The class loader from which to discover the default/system plugins (those not loaded from
plugin jars).public static WPPluginManager getInstance()
initialise(UUID)
or initialise(UUID, ClassLoader)
.