Module jakarta.mail

Class FactoryFinder

java.lang.Object
jakarta.mail.util.FactoryFinder

class FactoryFinder extends Object
  • Field Details

  • Constructor Details

    • FactoryFinder

      FactoryFinder()
  • Method Details

    • find

      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 - 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

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

      private static String fromSystemProperty(String factoryId)
    • isHk2Available

      private static boolean isHk2Available()
    • lookupUsingHk2ServiceLoader

      private static <T> T lookupUsingHk2ServiceLoader(String factoryId)
    • factoryFromServiceLoader

      private static <T> T factoryFromServiceLoader(Class<T> factory)
    • checkPackageAccess

      private static void checkPackageAccess(String className)