|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gvsig.tools.util.impl.DefaultServiceLoader
public class DefaultServiceLoader
Implementation which uses reflection to try to use first the standard JDK utilities to load service implementation classes, which are available since JDK 1.6. If it fails or the JDK used is < 1.6, the old mechanism based on the usage of internal sun classes is used.
To register your implementations classes eLfor a service, use the mechanism explained in the Java JAR file specification for the JDK version you are using:
Constructor Summary | |
---|---|
DefaultServiceLoader()
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultServiceLoader()
Method Detail |
---|
public void addClassLoader(ClassLoader classLoader)
ServiceLoader
ClassLoader
to use to find services, in the case we don't
provide one.
addClassLoader
in interface ServiceLoader
public Set load(Class serviceClass)
ServiceLoader
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 ServiceLoader.addClassLoader(ClassLoader)
method, if any.
load
in interface ServiceLoader
serviceClass
- the interface or class which the loaded objects must implement
or extend
Set
of loaded object instancespublic Set load(Class serviceClass, ClassLoader classLoader)
ServiceLoader
Set
of a object instances which implement or extended a
common service interface or class. The classes are loaded through the
provided ClassLoader
load
in interface ServiceLoader
serviceClass
- the interface or class which the loaded objects must implement
or extendclassLoader
- the ClassLoader
to load the classes from
Set
of loaded object instances
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |