rabejens
rabejens

Reputation: 8142

Is there a simple service registry for Java?

I have an interface like SomeProvider and several SomeProviderImpls. 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

Answers (1)

Zielu
Zielu

Reputation: 8562

There is java.util.ServiceLoader in java that allows simple registration and retrieval of the services.

Upvotes: 2

Related Questions