final class FactoryFinder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.logging.Logger |
LOGGER |
Modifier | Constructor and Description |
---|---|
private |
FactoryFinder() |
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.Object |
find(java.lang.String factoryId,
java.lang.String fallbackClassName)
Finds the implementation
Class object for the given
factory name, or if that fails, finds the Class object
for the given fallback class name. |
(package private) static java.lang.ClassLoader |
getContextClassLoader() |
private static java.lang.Object |
newInstance(java.lang.String className,
java.lang.ClassLoader classLoader)
Creates an instance of the specified class using the specified
ClassLoader object. |
static java.lang.ClassLoader getContextClassLoader()
private static java.lang.Object newInstance(java.lang.String className, java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundException
ClassLoader
object.className
- name of the class to be instantiated.classLoader
- class loader to be used.java.lang.ClassNotFoundException
- if the given class could not be found
or could not be instantiated.static java.lang.Object find(java.lang.String factoryId, java.lang.String fallbackClassName) throws java.lang.ClassNotFoundException
Class
object for the given
factory name, or if that fails, finds the Class
object
for the given fallback class name. The arguments supplied MUST be
used in order. If using the first argument is successful, the second
one will not be used.
This method is package private so that this code can be shared.
factoryId
- the name of the factory to find, which is
a system property.fallbackClassName
- the implementation class name, which is
to be used only if nothing else.
is found; null
to indicate that
there is no fallback class name.Class
object of the specified message factory;
may not be null
.java.lang.ClassNotFoundException
- if the given class could not be found
or could not be instantiated.