Reputation: 8142
I have an interface like SomeProvider
and several SomeProviderImpl
s. I now want to register all my implementations at a central place and have something like Registry.get(SomeProvider.class, param1, param2, ...)
to query one of the implementations.
Since OSGi and OSGi DS would be like nuking a fly, I am about to roll my own simple and tiny registry, but I wanted to know if something like that already exists.
Upvotes: 1
Views: 1594
Reputation: 8562
There is java.util.ServiceLoader
in java that allows simple registration and retrieval of the services.
Upvotes: 2