class FactoryFinder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
FactoryFinder.ConfigurationError |
Modifier and Type | Field and Description |
---|---|
private static boolean |
debug
Set to true for debugging.
|
Constructor and Description |
---|
FactoryFinder() |
Modifier and Type | Method and Description |
---|---|
private static void |
debugPrintln(java.lang.String msg) |
(package private) static java.lang.Object |
find(java.lang.Class<?> factoryType,
java.lang.String fallbackClassName)
Finds the implementation Class object in the specified order.
|
private static java.lang.ClassLoader |
findClassLoader()
Figure out which ClassLoader to use.
|
private static java.lang.Object |
newInstance(java.lang.String className,
java.lang.ClassLoader classLoader)
Create an instance of a class using the specified
ClassLoader , or if that fails from the
ClassLoader that loaded this class. |
private static final boolean debug
private static void debugPrintln(java.lang.String msg)
private static java.lang.ClassLoader findClassLoader() throws FactoryFinder.ConfigurationError
ClassLoader
FactoryFinder.ConfigurationError
- if this class is unable to work with the
host JDKprivate static java.lang.Object newInstance(java.lang.String className, java.lang.ClassLoader classLoader) throws FactoryFinder.ConfigurationError
ClassLoader
, or if that fails from the
ClassLoader
that loaded this class.className
- the name of the class to instantiateclassLoader
- a ClassLoader
to load the class fromObject
that is an instance of the class of
the given name from the given class loaderFactoryFinder.ConfigurationError
- if the class could not be found or
instantiatedstatic java.lang.Object find(java.lang.Class<?> factoryType, java.lang.String fallbackClassName) throws FactoryFinder.ConfigurationError
factoryId
- Name of the factory to find, same as
a property namefallbackClassName
- Implementation class name, if nothing else
is found. Use null to mean no fallback.FactoryFinder.ConfigurationError
- Package private so this code can be shared.