de.smartics.exceptions.runtime
Class Helper
java.lang.Object
de.smartics.exceptions.runtime.Helper
-
public final class Helper
-
extends
Object
Provides helper methods for this package.
This is internal API.
-
Author:
-
Robert Reiner
Method Summary |
static
|
loadService(Class<T> clazz, ClassLoader classLoader) Loads the service from the META-INF/services and therefore mimics the ServiceLoader functionality of JSE 1.6 to some extend. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
loadService
public static <T> T loadService(Class<T> clazz,
ClassLoader classLoader)
-
Loads the service from the
META-INF/services
and therefore mimics the
ServiceLoader
functionality of JSE 1.6 to some extend.
-
-
Type Parameters:
-
T
- the type of the service to load.
-
Parameters:
-
clazz
- the class instance to read an implementation for. The name of the class (including the package) is the name of the file expected in the
META-INF/services
directory.
-
classLoader
- the class loader to use to read resources from the
META-INF/services
directory within the classpath.
-
Returns:
-
the instance of the class whose name is found in the file specified
clazz
. The name of the class found in the file is required to be a subclass of the class given by
clazz
.
Copyright © 2007-null
Kronseder & Reiner GmbH - smartics. All Rights Reserved.