java.lang.Object
jakarta.mail.util.FactoryFinder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcheckPackageAccess(String className) private static <T> TfactoryFromServiceLoader(Class<T> factory, ClassLoader loader) (package private) static <T> TFinds the implementationClassobject for the given factory type.private static <T> Tfind(Class<T> factoryClass, ClassLoader loader) private static StringfromSystemProperty(String factoryId) private static Class<?>[]getHk2ServiceLoaderTargets(Class<?> factoryClass) private static <T> TlookupUsingHk2ServiceLoader(Class<T> factoryClass, ClassLoader loader) private static <T> TnewInstance(String className, Class<T> factoryClass, ClassLoader classLoader)
-
Constructor Details
-
FactoryFinder
FactoryFinder()
-
-
Method Details
-
find
Finds the implementationClassobject 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- factory abstract class or interface to be found- Returns:
- the
Classobject of the specified message factory - Throws:
RuntimeException- if there is an error
-
find
- Throws:
RuntimeException
-
newInstance
private static <T> T newInstance(String className, Class<T> factoryClass, ClassLoader classLoader) throws RuntimeException - Throws:
RuntimeException
-
fromSystemProperty
-
getHk2ServiceLoaderTargets
-
lookupUsingHk2ServiceLoader
-
factoryFromServiceLoader
-
checkPackageAccess
-