class FactoryFinder
extends java.lang.Object
Constructor and Description |
---|
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. |
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. |
private static java.lang.Object newInstance(java.lang.String className, java.lang.ClassLoader classLoader) throws ServiceException
ClassLoader
object.ServiceException
- if the given class could not be found
or could not be instantiatedstatic java.lang.Object find(java.lang.String factoryId, java.lang.String fallbackClassName) throws ServiceException
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 propertyfallbackClassName
- the implementation class name, which is
to be used only if nothing else
is found; null
to indicate that
there is no fallback class nameClass
object of the specified message factory;
may not be null
ServiceException
- if there is an error