sun.com/j2se/1.3/docs/guide/jar/jar.html) to locate a service named
SPI.class.getName()
. This is implemented internally, so there is not a dependency on JDK 1.3+.
If the name of the implementation class is non-null, load that class. The class loaded is the first class loaded by the following sequence of class loaders: - Thread Context Class Loader
- DiscoverSingleton's Caller's Class Loader
- SPI's Class Loader
- DiscoverSingleton's (this class or wrapper) Class Loader
- System Class Loader
An exception is thrown if the class cannot be loaded. If the name of the implementation class is null, AND the default implementation class name (defaultImpl
) is null, then an exception is thrown. If the name of the implementation class is null, AND the default implementation class (defaultImpl
) is non-null, then load the default implementation class. The class loaded is the first class loaded by the following sequence of class loaders: - SPI's Class Loader
- DiscoverSingleton's (this class or wrapper) Class Loader
- System Class Loader
This limits the scope in which the default class loader can be found to the SPI, DiscoverSingleton, and System class loaders. The assumption here is that the default implementation is closely associated with the SPI or system, and is not defined in the user's application space.
An exception is thrown if the class cannot be loaded.
Verify that the loaded class implements the SPI: an exception is thrown if the loaded class does not implement the SPI. IMPLEMENTATION NOTE - This implementation is modelled after the SAXParserFactory and DocumentBuilderFactory implementations (corresponding to the JAXP pluggability APIs) found in Apache Xerces.
@version $Revision: 1090010 $ $Date: 2011-04-07 23:05:58 +0200 (Thu, 07 Apr 2011) $