Package kos.core

Class ImplementationLoader.SPIImplementationLoader

    • Constructor Detail

      • SPIImplementationLoader

        public SPIImplementationLoader()
    • Method Detail

      • instancesExposedAs

        public <T> Iterable<T> instancesExposedAs​(Class<T> interfaceType)
        Description copied from interface: ImplementationLoader
        Loads classes exposed by the given interfaceType.
        Specified by:
        instancesExposedAs in interface ImplementationLoader
        Type Parameters:
        T - same type as interfaceType
        Parameters:
        interfaceType - an abstract class or interface in which concrete implementations is expected to be loaded
        Returns:
        found implementations or empty Iterable if none was found.
      • instanceOf

        public <T> Lang.Result<T> instanceOf​(Class<T> interfaceType)
        Description copied from interface: ImplementationLoader
        Load the instance of the given type.
        Specified by:
        instanceOf in interface ImplementationLoader
        Type Parameters:
        T - same type as type
        Parameters:
        interfaceType - expected class to be loaded.
        Returns:
        an Optional instance containing or not the found instance.