Package kos.api
Class ImplementationLoader.SPIImplementationLoader
java.lang.Object
kos.api.ImplementationLoader.SPIImplementationLoader
- All Implemented Interfaces:
ImplementationLoader
- Enclosing interface:
- ImplementationLoader
public static class ImplementationLoader.SPIImplementationLoader
extends Object
implements ImplementationLoader
-
Nested Class Summary
Nested classes/interfaces inherited from interface kos.api.ImplementationLoader
ImplementationLoader.Result<T>, ImplementationLoader.SPIImplementationLoader -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> ImplementationLoader.Result<T>instanceOf(Class<T> type) Load the instance of the giventype.<T> Iterable<T>instancesExposedAs(Class<T> interfaceType) Loads classes exposed by the giveninterfaceType.<T> voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface kos.api.ImplementationLoader
anyInstanceOf, instanceOfOrFail
-
Field Details
-
instances
-
-
Constructor Details
-
SPIImplementationLoader
public SPIImplementationLoader()
-
-
Method Details
-
instancesExposedAs
Description copied from interface:ImplementationLoaderLoads classes exposed by the giveninterfaceType.- Specified by:
instancesExposedAsin interfaceImplementationLoader- Type Parameters:
T- same type asinterfaceType- Parameters:
interfaceType- an abstract class or interface in which concrete implementations is expected to be loaded- Returns:
- found implementations or empty
Iterableif none was found.
-
instanceOf
Description copied from interface:ImplementationLoaderLoad the instance of the giventype.- Specified by:
instanceOfin interfaceImplementationLoader- Type Parameters:
T- same type astype- Parameters:
type- expected class to be loaded.- Returns:
- an
Optionalinstance containing or not the found instance.
-
register
- Specified by:
registerin interfaceImplementationLoader
-