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

java.lang.Object
  extended by com.openexchange.admin.console.ServiceLoader<S>
Type Parameters:
S -
All Implemented Interfaces:
java.lang.Iterable<S>

public class ServiceLoader<S>
extends java.lang.Object
implements java.lang.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
 java.util.Iterator<S> iterator()
           
static
<S> ServiceLoader<S>
load(java.lang.Class<S> service)
           
static
<S> ServiceLoader<S>
load(java.lang.Class<S> service, java.lang.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(java.lang.Class<S> service)
                             throws java.lang.IllegalAccessException,
                                    java.lang.InstantiationException,
                                    java.lang.ClassNotFoundException,
                                    java.io.IOException
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.io.IOException

load

public static <S> ServiceLoader<S> load(java.lang.Class<S> service,
                                        java.lang.ClassLoader loader)
                             throws java.lang.IllegalAccessException,
                                    java.lang.InstantiationException,
                                    java.lang.ClassNotFoundException,
                                    java.io.IOException
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.io.IOException

iterator

public java.util.Iterator<S> iterator()
Specified by:
iterator in interface java.lang.Iterable<S>