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(ClassLoader classLoader)
Adds a
ClassLoader to use to find services, in the case we don't
provide one. |
Set |
load(Class serviceClass)
Loads a
Set of a object instances which implement or extended a
common service interface or class. |
Set |
load(Class serviceClass,
ClassLoader classLoader)
Loads a
Set of a object instances which implement or extended a
common service interface or class. |
Set load(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 instancesSet load(Class serviceClass, 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(ClassLoader classLoader)
ClassLoader
to use to find services, in the case we don't
provide one.classLoader
-