org.richfaces.application

## Class ServiceLoader

- java.lang.Object
- - 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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <S> S` | `loadService(Class<S> serviceClass)`
    `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 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)

    - #### loadService

          public static <S> S loadService(Class<S> serviceClass)

    - #### loadServiceClasses

          public static <S> Collection<Class<? extends S>> loadServiceClasses(Class<S> serviceClass)
                                                                   throws ServiceException

      Load service implementation classes.

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

Copyright © 2016 JBoss by Red Hat. All Rights Reserved.