Interface ComponentLoader


public interface ComponentLoader
A loader for components that are discovered via SPI.
  • Method Details

    • load

      <T> Iterable<T> load(Class<T> spiClass)
      Load implementations of an SPI.
      Type Parameters:
      T - the SPI type
      Parameters:
      spiClass - the SPI class
      Returns:
      iterable of SPI implementations
    • forClassLoader

      static ComponentLoader forClassLoader(ClassLoader classLoader)
      Create an instance for the classLoader using ServiceLoader.load(Class, ClassLoader).
    • loadList

      static <T> List<T> loadList(ComponentLoader componentLoader, Class<T> spiClass)
      Convenience method to load a list of SPI implementations rather than the iterable returned by load(Class).
      Since:
      1.61.0