Package javax.xml.rpc

Class 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) $
    • 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 specified ClassLoader, or if that fails from the ClassLoader that loaded this class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • FactoryFinder

        FactoryFinder()
    • 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 specified ClassLoader, or if that fails from the ClassLoader that loaded this class.
        Parameters:
        className - the name of the class to instantiate
        classLoader - a ClassLoader 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 name
        fallbackClassName - 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.