Top Fields Constructors Methods
jakarta.activation

pack-priv Class FactoryFinder

extends Object
Class Inheritance
Imports
java.lang.reflect.Method, java.security.AccessController, .PrivilegedAction, java.util.Arrays, .Iterator, java.util.logging.Level, .Logger

Field Summary

Modifier and TypeField and Description
private static final ServiceLoaderUtil.ExceptionHandler<RuntimeException>
private static final Logger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static <T> T

Returns:

the Class object of the specified message factory; may not be null
find
(Class<T>
factory abstract class or interface to be found
factoryClass
)

Finds the implementation Class object for the given factory type.

pack-priv static <T> T
find(Class<T> factoryClass, ClassLoader loader)

private static String
private static ClassLoader[]
getClassLoaders(final Class<?>... classes)

private static Class<?>[]
private static String
getSystemProperty(final String property)

private static void
private static <T> T
private static <T> T
newInstance(String className, Class<? extends T> service, ClassLoader loader)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EXCEPTION_HANDLERback to summary
private static final ServiceLoaderUtil.ExceptionHandler<RuntimeException> EXCEPTION_HANDLER
loggerback to summary
private static final Logger logger

Constructor Detail

FactoryFinderback to summary
pack-priv FactoryFinder()

Method Detail

findback to summary
pack-priv static <T> T find(Class<T> factoryClass) throws RuntimeException

Finds the implementation Class object for the given factory type.

This method is package private so that this code can be shared.

Parameters
factoryClass:Class<T>

factory abstract class or interface to be found

Returns:T

the Class object of the specified message factory; may not be null

Exceptions
IllegalStateException:
if there is no factory found
findback to summary
pack-priv static <T> T find(Class<T> factoryClass, ClassLoader loader) throws RuntimeException
fromSystemPropertyback to summary
private static String fromSystemProperty(String factoryId)
getClassLoadersback to summary
private static ClassLoader[] getClassLoaders(final Class<?>... classes)
getHk2ServiceLoaderTargetsback to summary
private static Class<?>[] getHk2ServiceLoaderTargets(Class<?> factoryClass)
getSystemPropertyback to summary
private static String getSystemProperty(final String property)
logFoundback to summary
private static void logFound(String value)
lookupUsingHk2ServiceLoaderback to summary
private static <T> T lookupUsingHk2ServiceLoader(Class<T> factoryClass, ClassLoader loader)
Annotations
@SuppressWarnings:unchecked
newInstanceback to summary
private static <T> T newInstance(String className, Class<? extends T> service, ClassLoader loader) throws RuntimeException