[hibernate-dev] [HSearch] ServiceManager and services

Emmanuel Bernard emmanuel at hibernate.org
Mon Oct 15 17:45:43 EDT 2012


On Mon 2012-10-15 18:19, Hardy Ferentschik wrote:
> > Basically for you a Service must allow for multiple implementations
> > and a ServiceManager must offer a way to switch between various
> > implementations.
> 
> I orientate myself in this case at the ServiceLoader docs (especially since we are using this mechanism as well) which says:
> "A service is a well-known set of interfaces and (usually abstract) classes. A service provider is a specific implementation of a service."
> 
> What I am saying is that by calling it a ServiceManager and by using the ServiceLoader API I have a certain expectation on how things 
> will work. I would have expected that each of the services has its own service file and that we determine the service to use by using the 
> Service Loader API + some config code.

I don't think we use the ServiceLoader API nor implementation. though we
do reuse the pattern of finding services by a the META-INF service.

What is a bit unfortunate is that what the JDK ServiceLoader calls a
service, we call it a ServiceProvider and what they call a service
provider we call it a given implementation of ServiceProvider offering
the lifecycle management of a specific service.

In other words, the service we offer is the service provider lifecycle.
We hopped one level.


More information about the hibernate-dev mailing list