|
Currently there is a concept of provided services in ServiceManager which allows to provide services programmatically. These services have precedence over discovered services.
There are a couple of considerations:
-
Currently these services are neither started or stopped. I guess the assumption is that this is taken care of by the provider of the services. Personally I am not sure whether it would be better to mange the life cycle of these services as well.
-
the way to add a provided service is to get the map of existing provided services and add to it. eg configuration.getProvidedServices().put( FooService.class, new FooService() ). I think we should offer a dedicated method for that and make the getter return an unmodifiable map
-
there are several services which are completely internal. They should become internal provided services instead of being discovered via the ServiceLoader. This requires that we work out how the life cycle of provided services is supposed to work.
|