java.lang.Object
jakarta.xml.ws.spi.FactoryFinder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ServiceLoaderUtil.ExceptionHandler<WebServiceException> private static final Loggerprivate static final Stringprivate static final PrivilegedAction<String> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static <T> TFinds the implementationClassobject for the given factory name, or if that fails, finds theClassobject for the given fallback class name.private static <T> TfromSystemProperty(String factoryId, String fallbackClassName, ClassLoader classLoader) private static ClassLoadergetClassClassLoader(Class<?> c) private static ClassLoaderprivate static booleanisOsgi()private static <T> TlookupUsingOSGiServiceLoader(String factoryId) private static <T> TnewInstance(String className, String defaultImplClassName, ClassLoader classLoader) (package private) static URLGet the URL for the Class from it's ClassLoader.(package private) static URLwhich(Class<?> clazz, 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 Details
-
LOGGER
-
EXCEPTION_HANDLER
-
propertyAction
-
OSGI_SERVICE_LOADER_CLASS_NAME
- See Also:
-
-
Constructor Details
-
FactoryFinder
FactoryFinder()
-
-
Method Details
-
find
Finds the implementationClassobject for the given factory name, or if that fails, finds theClassobject 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;nullto indicate that there is no fallback class name- Returns:
- the
Classobject of the specified message factory; may not benull - Throws:
WebServiceException- if there is an error
-
fromSystemProperty
private static <T> T fromSystemProperty(String factoryId, String fallbackClassName, ClassLoader classLoader) -
isOsgi
private static boolean isOsgi() -
lookupUsingOSGiServiceLoader
-
newInstance
private static <T> T newInstance(String className, String defaultImplClassName, ClassLoader classLoader) -
which
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
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
-
getClassClassLoader
-