ServicesManager

interface ServicesManager

The manager of services.

Functions

Link copied to clipboard
abstract fun <T> getProvider(clazz: Class<T>): ServiceProvider<T>?

Gets the service provider for the service of the given clazz type, or returns null if there is no service provider for the given clazz.

Link copied to clipboard

Gets the provider for the given type T, or returns null if there is no provider for the given type T.

Link copied to clipboard
abstract fun <T> provide(clazz: Class<T>): T?

Gets the service for the given clazz, or returns null if there is no service registered for the given clazz.

Link copied to clipboard
inline fun <T> ServicesManager.provide(): T?

Gets the service for the given type T, or returns null if there is no registered service for the given type T.

Link copied to clipboard
abstract fun <T> register(plugin: Any, type: Class<T>, service: T): ServiceProvider<T>
abstract fun <T> register(plugin: PluginContainer, type: Class<T>, service: T): ServiceProvider<T>

Registers a new service to this services manager.

Link copied to clipboard
inline fun <T> ServicesManager.register(plugin: Any, service: T)
inline fun <T> ServicesManager.register(plugin: PluginContainer, service: T)

Registers a new service to this services manager.