Interface FactoryFinder


public interface FactoryFinder
Finder to find factories from the resource classpath, usually META-INF/services/org/apache/camel/.
  • Field Details

  • Method Details

    • getResourcePath

      String getResourcePath()
      Gets the resource classpath.
      Returns:
      the resource classpath.
    • newInstance

      Optional<Object> newInstance(String key)
      Creates a new class instance using the key to lookup
      Parameters:
      key - is the key to add to the path to find a text file containing the factory name
      Returns:
      a newly created instance (if exists)
    • newInstance

      <T> Optional<T> newInstance(String key, Class<T> type)
      Creates a new class instance using the key to lookup
      Parameters:
      key - is the key to add to the path to find a text file containing the factory name
      type - the class type
      Returns:
      a newly created instance (if exists)
    • findClass

      Optional<Class<?>> findClass(String key)
      Finds the given factory class using the key to lookup.
      Parameters:
      key - is the key to add to the path to find a text file containing the factory name
      Returns:
      the factory class
    • findOptionalClass

      Optional<Class<?>> findOptionalClass(String key)
      Finds the optional factory class using the key to lookup.
      Parameters:
      key - is the key to add to the path to find a text file containing the factory name
      Returns:
      the factory class if found, or null if no class existed
    • clear

      void clear()
      Clear the resolver state from previous scans.