org.freecompany.util.services
public class ServiceDiscovery extends Object
These service objects can be used to find concrete implementations of service provider interfaces. The service discovery factory also provides caching for these information objects.
For example, to find the first known concrete provider for the interface {@code ServiceInterface}:
{@code ServiceInterface service = ServiceDiscovery.getInstance().findService( ServiceInterface.class);}
Field Summary | |
---|---|
protected static Map<String,ServiceInfo> | cache |
Method Summary | |
---|---|
static void | disableCaching()
Disables ServiceInfo caching within this helper. |
static void | enableCaching()
Enables ServiceInfo caching within this helper. |
static ServiceInfo | getInstance()
Returns a ServiceInfo instance that can access service providers
specified as a system property or through the class path using the standard
JAR services mechanism.
|
static ServiceInfo | getInstance(String system)
Returns a ServiceInfo instance that can access service providers
set as a system wide preference, specified as a system property, or through
the class path using the standard JAR services mechanism.
|
Returns: a ServiceInfo object that can be used to locate service providers.
Returns: a ServiceInfo object that can be used to locate service providers.