Services
Communication between framework and plugins, as well as between plugins is implemented using services in the framework. The ServiceManager keeps track of service interfaces and their implementations.
Retrieving a service
IServiceManager#<T>provide(Class<T> interface) returns an Optional<T> which contains the services instance if it has been registered.
If the Optional is redundant (for example, when retrieving framework or own services), the unsafe IServiceManager#<T>provideUnchecked(Class<T> interface) can be used.
Registering a service
To register a service, call IServiceManager#<T>registerService(Class<T> interface, T instance).
Updated almost 7 years ago
What’s Next