java.lang.Object
jakarta.mail.util.FactoryFinder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
checkPackageAccess
(String className) private static <T> T
factoryFromServiceLoader
(Class<T> factory) (package private) static <T> T
Finds the implementationClass
object for the given factory type.private static String
fromSystemProperty
(String factoryId) private static String
getSystemProperty
(String property) private static boolean
isOsgi()
private static <T> T
lookupUsingOSGiServiceLoader
(String factoryId) private static <T> T
newInstance
(String className)
-
Field Details
-
OSGI_SERVICE_LOADER_CLASS_NAME
- See Also:
-
-
Constructor Details
-
FactoryFinder
FactoryFinder()
-
-
Method Details
-
find
Finds the implementationClass
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
- factory abstract class or interface to be found- Returns:
- the
Class
object of the specified message factory - Throws:
RuntimeException
- if there is an error
-
newInstance
- Throws:
RuntimeException
-
fromSystemProperty
-
getSystemProperty
-
isOsgi
private static boolean isOsgi() -
lookupUsingOSGiServiceLoader
-
factoryFromServiceLoader
-
checkPackageAccess
-