Package javax.ws.rs.ext
Class FactoryFinder
- java.lang.Object
-
- javax.ws.rs.ext.FactoryFinder
-
final class FactoryFinder extends java.lang.ObjectFactory finder utility class.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.LoggerLOGGERprivate static java.lang.StringRESTEASY_JAXRS_API_MODULE
-
Constructor Summary
Constructors Modifier Constructor Description privateFactoryFinder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.Objectfind(java.lang.String factoryId, java.lang.String fallbackClassName)Finds the implementationClassobject for the given factory name, or if that fails, finds theClassobject for the given fallback class name.(package private) static java.lang.ClassLoadergetContextClassLoader()private static java.lang.ClassLoadergetModuleClassLoader()private static java.lang.ObjectnewInstance(java.lang.String className, java.lang.ClassLoader classLoader)Creates an instance of the specified class using the specifiedClassLoaderobject.
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
RESTEASY_JAXRS_API_MODULE
private static final java.lang.String RESTEASY_JAXRS_API_MODULE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getContextClassLoader
static java.lang.ClassLoader getContextClassLoader()
-
newInstance
private static java.lang.Object newInstance(java.lang.String className, java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundExceptionCreates an instance of the specified class using the specifiedClassLoaderobject.- Parameters:
className- name of the class to be instantiated.classLoader- class loader to be used.- Returns:
- instance of the specified class.
- Throws:
java.lang.ClassNotFoundException- if the given class could not be found or could not be instantiated.
-
find
static java.lang.Object find(java.lang.String factoryId, java.lang.String fallbackClassName) throws java.lang.ClassNotFoundExceptionFinds 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.
- Parameters:
factoryId- the name of the factory to find, which is a system property.fallbackClassName- 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:
java.lang.ClassNotFoundException- if there is an error.
-
getModuleClassLoader
private static java.lang.ClassLoader getModuleClassLoader()
-
-