org.tinyjee.maven.dim.spi.backport
Class ServiceLoader

java.lang.Object
  extended by org.tinyjee.maven.dim.spi.backport.ServiceLoader

public class ServiceLoader
extends Object

Minimum efforts backport of ServiceLoader found in Java 1.6 to be used in Java 1.5.

(May not behave in the same way and is meant to support adapter bindings only)

Note: This implementation searches inside "META-INF/services/typeName" and "typePackage/typeName.services". The latter is not standards compliant, but it works on Android where getting something into META-INF is quite an issue.

Author:
Juergen_Kellerer, 2011-09-27

Method Summary
static
<T> Iterable<T>
load(Class<T> serviceType)
          Loads the services that are specified by the given service type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

load

public static <T> Iterable<T> load(Class<T> serviceType)
Loads the services that are specified by the given service type.

Type Parameters:
T - the expected java type.
Parameters:
serviceType - the service type to load.
Returns:
a collection of service implementations.