java.lang.Object
jakarta.activation.FactoryFinder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ServiceLoaderUtil.ExceptionHandler<RuntimeException>
private static final Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static <T> T
Finds the implementationClass
object for the given factory type.(package private) static <T> T
find
(Class<T> factoryClass, ClassLoader loader) private static String
fromSystemProperty
(String factoryId) private static ClassLoader[]
getClassLoaders
(Class<?>... classes) private static Class<?>[]
getHk2ServiceLoaderTargets
(Class<?> factoryClass) private static String
getSystemProperty
(String property) private static void
private static <T> T
lookupUsingHk2ServiceLoader
(Class<T> factoryClass, ClassLoader loader) private static <T> T
newInstance
(String className, Class<? extends T> service, ClassLoader loader)
-
Field Details
-
logger
-
EXCEPTION_HANDLER
-
-
Constructor Details
-
FactoryFinder
FactoryFinder()
-
-
Method Details
-
find
Finds the implementationClass
object for the given factory type.This method is package private so that this code can be shared.
- Parameters:
factoryClass
- factory abstract class or interface to be found- Returns:
- the
Class
object of the specified message factory; may not benull
- Throws:
IllegalStateException
- if there is no factory foundRuntimeException
-
find
- Throws:
RuntimeException
-
newInstance
private static <T> T newInstance(String className, Class<? extends T> service, ClassLoader loader) throws RuntimeException - Throws:
RuntimeException
-
fromSystemProperty
-
getSystemProperty
-
logFound
-
getHk2ServiceLoaderTargets
-
lookupUsingHk2ServiceLoader
-
getClassLoaders
-