- java.lang.Object
-
- jakarta.xml.ws.spi.FactoryFinder
-
class FactoryFinder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static ServiceLoaderUtil.ExceptionHandler<WebServiceException>
EXCEPTION_HANDLER
private static java.util.logging.Logger
LOGGER
private static java.lang.String
OSGI_SERVICE_LOADER_CLASS_NAME
private static java.security.PrivilegedAction<java.lang.String>
propertyAction
-
Constructor Summary
Constructors Constructor Description FactoryFinder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static <T> T
find(java.lang.Class<T> factoryClass, java.lang.String fallbackClassName)
Finds the implementationClass
object for the given factory name, or if that fails, finds theClass
object for the given fallback class name.private static <T> T
fromSystemProperty(java.lang.String factoryId, java.lang.String fallbackClassName, java.lang.ClassLoader classLoader)
private static java.lang.ClassLoader
getClassClassLoader(java.lang.Class<?> c)
private static java.lang.ClassLoader
getSystemClassLoader()
private static boolean
isOsgi()
private static <T> T
lookupUsingOSGiServiceLoader(java.lang.String factoryId)
private static <T> T
newInstance(java.lang.String className, java.lang.String defaultImplClassName, java.lang.ClassLoader classLoader)
(package private) static java.net.URL
which(java.lang.Class<?> clazz)
Get the URL for the Class from it's ClassLoader.(package private) static java.net.URL
which(java.lang.Class<?> clazz, java.lang.ClassLoader loader)
Search the given ClassLoader for an instance of the specified class and return a string representation of the URL that points to the resource.
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
EXCEPTION_HANDLER
private static final ServiceLoaderUtil.ExceptionHandler<WebServiceException> EXCEPTION_HANDLER
-
propertyAction
private static final java.security.PrivilegedAction<java.lang.String> propertyAction
-
OSGI_SERVICE_LOADER_CLASS_NAME
private static final java.lang.String OSGI_SERVICE_LOADER_CLASS_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
find
static <T> T find(java.lang.Class<T> factoryClass, java.lang.String fallbackClassName)
Finds the implementationClass
object for the given factory name, or if that fails, finds theClass
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.
- Type Parameters:
T
- type of the factory class- Parameters:
factoryClass
- 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 name- Returns:
- the
Class
object of the specified message factory; may not benull
- Throws:
WebServiceException
- if there is an error
-
fromSystemProperty
private static <T> T fromSystemProperty(java.lang.String factoryId, java.lang.String fallbackClassName, java.lang.ClassLoader classLoader)
-
isOsgi
private static boolean isOsgi()
-
lookupUsingOSGiServiceLoader
private static <T> T lookupUsingOSGiServiceLoader(java.lang.String factoryId)
-
newInstance
private static <T> T newInstance(java.lang.String className, java.lang.String defaultImplClassName, java.lang.ClassLoader classLoader)
-
which
static java.net.URL which(java.lang.Class<?> clazz)
Get the URL for the Class from it's ClassLoader. Convenience method forwhich(Class, ClassLoader)
. Equivalent to calling: which(clazz, clazz.getClassLoader())- Parameters:
clazz
- The class to search for- Returns:
- the URL for the class or null if it wasn't found
-
which
static java.net.URL which(java.lang.Class<?> clazz, java.lang.ClassLoader loader)
Search the given ClassLoader for an instance of the specified class and return a string representation of the URL that points to the resource.- Parameters:
clazz
- The class to search forloader
- The ClassLoader to search. If this parameter is null, then the system class loader will be searched- Returns:
- the URL for the class or null if it wasn't found
-
getSystemClassLoader
private static java.lang.ClassLoader getSystemClassLoader()
-
getClassClassLoader
private static java.lang.ClassLoader getClassClassLoader(java.lang.Class<?> c)
-
-