com.openexchange.admin.console
Class ServiceLoader<S>

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

Method Summary
 Iterator<S> iterator()
           
static
<S> ServiceLoader<S>
load(Class<S> service)
           
static
<S> ServiceLoader<S>
load(Class<S> service, ClassLoader loader)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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>