org.richfaces.application
Class ServiceLoader

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

public final class ServiceLoader
extends java.lang.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(java.lang.Class<S> serviceClass, java.lang.Class<? extends S> defaultImplementation)
           
static
<S> java.util.Collection<java.lang.Class<? extends S>>
loadServiceClasses(java.lang.Class<S> serviceClass)
          

Load service implementation classes.

static
<S> java.util.Collection<S>
loadServices(java.lang.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> java.util.Collection<S> loadServices(java.lang.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(java.lang.Class<S> serviceClass,
                                java.lang.Class<? extends S> defaultImplementation)

loadServiceClasses

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

Load service implementation classes.

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


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