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> TFinds the implementationClassobject for the given factory type.(package private) static <T> Tfind(Class<T> factoryClass, ClassLoader loader) private static StringfromSystemProperty(String factoryId) private static ClassLoader[]getClassLoaders(Class<?>... classes) private static Class<?>[]getHk2ServiceLoaderTargets(Class<?> factoryClass) private static StringgetSystemProperty(String property) private static voidprivate static <T> TlookupUsingHk2ServiceLoader(Class<T> factoryClass, ClassLoader loader) private static <T> TnewInstance(String className, Class<? extends T> service, ClassLoader loader)
-
Field Details
-
logger
-
EXCEPTION_HANDLER
-
-
Constructor Details
-
FactoryFinder
FactoryFinder()
-
-
Method Details
-
find
Finds the implementationClassobject 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
Classobject 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
-