com.openexchange.admin.console
Class ServiceLoader<S>
java.lang.Object
com.openexchange.admin.console.ServiceLoader<S>
- Type Parameters:
S
-
- All Implemented Interfaces:
- Iterable<S>
public class ServiceLoader<S>
- extends Object
- implements Iterable<S>
This class aims to be a compensation for the missing ServiceLoader in JDK 5.
Note that the instantiation isn't done lazily compared to the ServiceLoader in
JDK 6
- Author:
- Dennis Sieben
load
public static <S> ServiceLoader<S> load(Class<S> service)
throws IllegalAccessException,
InstantiationException,
ClassNotFoundException,
IOException
- Throws:
IllegalAccessException
InstantiationException
ClassNotFoundException
IOException
load
public static <S> ServiceLoader<S> load(Class<S> service,
ClassLoader loader)
throws IllegalAccessException,
InstantiationException,
ClassNotFoundException,
IOException
- Throws:
IllegalAccessException
InstantiationException
ClassNotFoundException
IOException
iterator
public Iterator<S> iterator()
- Specified by:
iterator
in interface Iterable<S>