Top Fields Constructors Methods
jakarta.mail.util

pack-priv Class FactoryFinder

extends Object
Class Inheritance
Imports
java.lang.reflect.Method, java.security.AccessController, .PrivilegedAction, java.util.Iterator, .ServiceLoader

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

Returns:

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

Finds the implementation Class object for the given factory type.

private static String
private static String
getSystemProperty(final String property)

private static boolean
private static <T> T
private static <T> T
newInstance(String className)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

OSGI_SERVICE_LOADER_CLASS_NAMEback to summary
private static final String OSGI_SERVICE_LOADER_CLASS_NAME

Constructor Detail

FactoryFinderback to summary
pack-priv FactoryFinder()

Method Detail

checkPackageAccessback to summary
private static void checkPackageAccess(String className)
factoryFromServiceLoaderback to summary
private static <T> T factoryFromServiceLoader(Class<T> factory)
findback to summary
pack-priv static <T> T find(Class<T> factoryClass) throws RuntimeException

Finds the implementation Class object for the given factory type. The arguments supplied must be used in order 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

Exceptions
RuntimeException:
if there is an error
fromSystemPropertyback to summary
private static String fromSystemProperty(String factoryId)
getSystemPropertyback to summary
private static String getSystemProperty(final String property)
isOsgiback to summary
private static boolean isOsgi()
lookupUsingOSGiServiceLoaderback to summary
private static <T> T lookupUsingOSGiServiceLoader(String factoryId)
Annotations
@SuppressWarnings:unchecked
newInstanceback to summary
private static <T> T newInstance(String className) throws RuntimeException
Annotations
@SuppressWarnings:unchecked