Class FactoryFinder

java.lang.Object
jakarta.activation.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.

      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; may not be null
      Throws:
      IllegalStateException - if there is no factory found
      RuntimeException
    • find

      static <T> T find(Class<T> factoryClass, ClassLoader loader) throws RuntimeException
      Throws:
      RuntimeException
    • newInstance

      private static <T> T newInstance(String className, Class<? extends T> service, ClassLoader loader) throws RuntimeException
      Throws:
      RuntimeException
    • fromSystemProperty

      private static String fromSystemProperty(String factoryId)
    • getSystemProperty

      private static String getSystemProperty(String property)
    • logFound

      private static void logFound(String value)
    • getHk2ServiceLoaderTargets

      private static Class<?>[] getHk2ServiceLoaderTargets(Class<?> factoryClass)
    • lookupUsingHk2ServiceLoader

      private static <T> T lookupUsingHk2ServiceLoader(Class<T> factoryClass, ClassLoader loader)
    • getClassLoaders

      private static ClassLoader[] getClassLoaders(Class<?>... classes)