Module jakarta.mail

Class FactoryFinder


  • class FactoryFinder
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      FactoryFinder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void checkPackageAccess​(java.lang.String className)  
      private static <T> T factoryFromServiceLoader​(java.lang.Class<T> factory)  
      (package private) static <T> T find​(java.lang.Class<T> factoryClass)
      Finds the implementation Class object for the given factory type.
      private static java.lang.String fromSystemProperty​(java.lang.String factoryId)  
      private static boolean isHk2Available()  
      private static <T> T lookupUsingHk2ServiceLoader​(java.lang.String factoryId)  
      private static <T> T newInstance​(java.lang.String className)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OSGI_SERVICE_LOADER_CLASS_NAME

        private static final java.lang.String OSGI_SERVICE_LOADER_CLASS_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • FactoryFinder

        FactoryFinder()
    • Method Detail

      • find

        static <T> T find​(java.lang.Class<T> factoryClass)
                   throws java.lang.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 - factory abstract class or interface to be found
        Returns:
        the Class object of the specified message factory
        Throws:
        java.lang.RuntimeException - if there is an error
      • newInstance

        private static <T> T newInstance​(java.lang.String className)
                                  throws java.lang.RuntimeException
        Throws:
        java.lang.RuntimeException
      • fromSystemProperty

        private static java.lang.String fromSystemProperty​(java.lang.String factoryId)
      • isHk2Available

        private static boolean isHk2Available()
      • lookupUsingHk2ServiceLoader

        private static <T> T lookupUsingHk2ServiceLoader​(java.lang.String factoryId)
      • factoryFromServiceLoader

        private static <T> T factoryFromServiceLoader​(java.lang.Class<T> factory)
      • checkPackageAccess

        private static void checkPackageAccess​(java.lang.String className)