org.apache.webbeans.corespi
Class ServiceLoader

java.lang.Object
  extended by org.apache.webbeans.corespi.ServiceLoader

public class ServiceLoader
extends Object

Loads any Service Provider Interface implementation declared in the OpenWebBeansConfiguration. The Configuration for Services looks like

 org.apache.webbeans.corespi.MyServiceInterface=my.package.webbeans.spi.MyServiceImplementation
 


Constructor Summary
ServiceLoader()
           
 
Method Summary
static
<T> T
getService(Class<T> serviceInterface)
          Get a new service singleton instance for the given interface.
static
<T> T
getService(Class<T> serviceInterface, ClassLoader cl)
          Get a new service singleton instance for the given interface.
 
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

getService

public static <T> T getService(Class<T> serviceInterface)
Get a new service singleton instance for the given interface.

Parameters:
serviceInterface -
Returns:
the new service implementation

getService

public static <T> T getService(Class<T> serviceInterface,
                               ClassLoader cl)
Get a new service singleton instance for the given interface.

Parameters:
serviceInterface -
classloader - to be used for lookup
Returns:
the new service implementation


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.