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.
IServiceManager#<T>provide(Class<T> interface) returns an
Optional<T> which contains the services instance if it has been registered.
Optional is redundant (for example, when retrieving framework or own services), the unsafe
IServiceManager#<T>provideUnchecked(Class<T> interface) can be used.
To register a service, call
IServiceManager#<T>registerService(Class<T> interface, T instance).
Updated over 2 years ago