Package javax.xml.rpc
Class FactoryFinder
- java.lang.Object
-
- javax.xml.rpc.FactoryFinder
-
class FactoryFinder extends java.lang.Object
This code is designed to implement the pluggability feature and is designed to both compile and run on JDK version 1.1 and later. The code also runs both as part of an unbundled jar file and when bundled as part of the JDK. This class is duplicated for each subpackage so keep it in sync. It is package private and therefore is not exposed as part of the JAXRPC API.- Version:
- $Rev: 924365 $ $Date: 2010-03-17 12:52:03 -0400 (Wed, 17 Mar 2010) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
FactoryFinder.ConfigurationError
-
Field Summary
Fields Modifier and Type Field Description private static boolean
debug
Set to true for debugging.
-
Constructor Summary
Constructors Constructor Description FactoryFinder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 specifiedClassLoader
, or if that fails from theClassLoader
that loaded this class.
-
-
-
Field Detail
-
debug
private static final boolean debug
Set to true for debugging.- See Also:
- Constant Field Values
-
-
Method Detail
-
debugPrintln
private static void debugPrintln(java.lang.String msg)
-
findClassLoader
private static java.lang.ClassLoader findClassLoader() throws FactoryFinder.ConfigurationError
Figure out which ClassLoader to use. For JDK 1.2 and later use the context ClassLoader.- Returns:
- the
ClassLoader
- Throws:
FactoryFinder.ConfigurationError
- if this class is unable to work with the host JDK
-
newInstance
private static java.lang.Object newInstance(java.lang.String className, java.lang.ClassLoader classLoader) throws FactoryFinder.ConfigurationError
Create an instance of a class using the specifiedClassLoader
, or if that fails from theClassLoader
that loaded this class.- Parameters:
className
- the name of the class to instantiateclassLoader
- aClassLoader
to load the class from- Returns:
- a new
Object
that is an instance of the class of the given name from the given class loader - Throws:
FactoryFinder.ConfigurationError
- if the class could not be found or instantiated
-
find
static java.lang.Object find(java.lang.Class<?> factoryType, java.lang.String fallbackClassName) throws FactoryFinder.ConfigurationError
Finds the implementation Class object in the specified order. Main entry point.- Parameters:
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.- Returns:
- Class object of factory, never null
- Throws:
FactoryFinder.ConfigurationError
- Package private so this code can be shared.
-
-