org.jboss.osgi.spi.util
Class ServiceLoader

java.lang.Object
  extended by org.jboss.osgi.spi.util.ServiceLoader

public abstract class ServiceLoader
extends Object

Loads service implementations from the requesters classpath.

Since:
14-Dec-2006
Author:
Thomas.Diesler@jboss.com

Constructor Summary
ServiceLoader()
           
 
Method Summary
static
<T> T
loadService(Class<T> serviceClass)
          Loads the first of a list of service implementations defined in META-INF/services/${serviceClass}
static
<T> List<T>
loadServices(Class<T> serviceClass)
          Loads a list of service implementations defined in META-INF/services/${serviceClass}
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceLoader

public ServiceLoader()
Method Detail

loadServices

public static <T> List<T> loadServices(Class<T> serviceClass)
Loads a list of service implementations defined in META-INF/services/${serviceClass}

Parameters:
serviceClass - The interface that is implemented by all loaded services
Returns:
The list of available service or an empty list

loadService

public static <T> T loadService(Class<T> serviceClass)
Loads the first of a list of service implementations defined in META-INF/services/${serviceClass}

Parameters:
serviceClass - The interface that is implemented by all loaded services
Returns:
The first available service or null


Copyright © 2010. All Rights Reserved.