PluginManager

class PluginManager : ContextAware, Iterable<Plugin>

The manager for plugin system. Should monitor plugin dependencies and locks.

Author

Alexander Nozik

Functions

find
Link copied to clipboard
common
fun find(inherit: Boolean = true, predicate: (Plugin) -> Boolean): Plugin?

Get existing plugin or return null if not present. Only first matching plugin is returned.

get
Link copied to clipboard
common
inline operator fun <T : Plugin> get(factory: PluginFactory<T>, recursive: Boolean = true): T?
inline operator fun <T : Any> get(tag: PluginTag? = null, recursive: Boolean = true): T?
operator fun get(tag: PluginTag, inherit: Boolean = true): Plugin?

Find a loaded plugin via its tag

operator fun <T : Any> get(type: KClass<out T>, tag: PluginTag? = null, recursive: Boolean = true): T?

Find a loaded plugin via its class. This method does not check if the result is unique and just returns first plugin matching the class condition. For safe search provide a tag since tags are checked on load and plugins with the same tag are not allowed in the same context.

iterator
Link copied to clipboard
common
open operator override fun iterator(): Iterator<Plugin>
list
Link copied to clipboard
common
fun list(inherit: Boolean): Collection<Plugin>

List plugins stored in this PluginManager. If inherit is true, include parent plugins as well

Properties

context
Link copied to clipboard
common
open override val context: Context

A context for this plugin manager