org.richfaces.application
Class ServiceLoader

java.lang.Object
  extended by org.richfaces.application.ServiceLoader

public final class ServiceLoader
extends Object

This class loads services from files placed to the META-INF/services in classpath.

Author:
asmirnov@exadel.com

Method Summary
static
<S> S
loadService(Class<S> serviceClass, Class<? extends S> defaultImplementation)
           
static
<S> Collection<Class<? extends S>>
loadServiceClasses(Class<S> serviceClass)
          

Load service implementation classes.

static
<S> Collection<S>
loadServices(Class<S> serviceClass)
          

Load and instantiate all service implementations.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadServices

public static <S> Collection<S> loadServices(Class<S> serviceClass)
                                  throws org.richfaces.application.ServiceException

Load and instantiate all service implementations.

Type Parameters:
S -
Parameters:
serviceClass -
Returns:
Throws:
ServiceException

loadService

public static <S> S loadService(Class<S> serviceClass,
                                Class<? extends S> defaultImplementation)

loadServiceClasses

public static <S> Collection<Class<? extends S>> loadServiceClasses(Class<S> serviceClass)
                                                         throws org.richfaces.application.ServiceException

Load service implementation classes.

Type Parameters:
S -
Parameters:
serviceClass -
Returns:
Throws:
ServiceException


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.