public interface ServiceLoader
Has the same purpose as the java.util.ServiceLoader class available since JDK 1.6.
Modifier and Type | Method and Description |
---|---|
void |
addClassLoader(java.lang.ClassLoader classLoader)
Adds a
ClassLoader to use to find services, in the case we don't
provide one. |
java.util.Set |
load(java.lang.Class serviceClass)
Loads a
Set of a object instances which implement or extended a
common service interface or class. |
java.util.Set |
load(java.lang.Class serviceClass,
java.lang.ClassLoader classLoader)
Loads a
Set of a object instances which implement or extended a
common service interface or class. |
java.util.Set load(java.lang.Class serviceClass)
Set
of a object instances which implement or extended a
common service interface or class. The services will be loaded using the
current ClassLoader
and the list of ClassLoader
s provided
with the addClassLoader(ClassLoader)
method, if any.serviceClass
- the interface or class which the loaded objects must implement
or extendSet
of loaded object instancesjava.util.Set load(java.lang.Class serviceClass, java.lang.ClassLoader classLoader)
Set
of a object instances which implement or extended a
common service interface or class. The classes are loaded through the
provided ClassLoader
serviceClass
- the interface or class which the loaded objects must implement
or extendclassLoader
- the ClassLoader
to load the classes fromSet
of loaded object instancesvoid addClassLoader(java.lang.ClassLoader classLoader)
ClassLoader
to use to find services, in the case we don't
provide one.classLoader
-