org.apache.pivot.util
Class Service

java.lang.Object
  extended by org.apache.pivot.util.Service

public class Service
extends Object

Utility class for locating and instantiating service providers.


Constructor Summary
Service()
           
 
Method Summary
static Object getProvider(String providerName)
          Attempts to load a service provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Service

public Service()
Method Detail

getProvider

public static Object getProvider(String providerName)
Attempts to load a service provider.

Parameters:
providerName - The name of the provider to load. The method first looks for a system property with this name. The value of the property is expected to be the name of a class that implements the expected provider interface.

If the system property does not exist, the method then attempts to load a resource with this name from the META-INF/services directory. The resource is expected to be a text file containing a single line that is the name of the provider class.