Package com.sap.cds.services.runtime
Class ExtendedServiceLoader
java.lang.Object
com.sap.cds.services.runtime.ExtendedServiceLoader
Loads implementations of classes via Java's
ServiceLoader and provides the CdsRuntime to these if requested through the CdsRuntimeAware interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Iterator<T>Loads all implementations of the given class.static <T> Iterator<T>loadAll(Class<T> clazz, CdsRuntime runtime) Loads all implementations of the given class.static <T> TloadSingle(Class<T> clazz) Loads the first implementation of the given class.static <T> TloadSingle(Class<T> clazz, CdsRuntime runtime) Loads the first implementation of the given class.
-
Constructor Details
-
ExtendedServiceLoader
public ExtendedServiceLoader()
-
-
Method Details
-
loadAll
Loads all implementations of the given class. The loaded implementations may NOT request theCdsRuntimethroughCdsRuntimeAware.- Type Parameters:
T- the type- Parameters:
clazz- the class- Returns:
- the implementations
-
loadAll
Loads all implementations of the given class. The loaded implementations may request theCdsRuntimethroughCdsRuntimeAware.- Type Parameters:
T- the type- Parameters:
clazz- the classruntime- theCdsRuntime- Returns:
- the implementations, initialized with the
CdsRuntime
-
loadSingle
Loads the first implementation of the given class. The loaded implementation may NOT request theCdsRuntimethroughCdsRuntimeAware.- Type Parameters:
T- the type- Parameters:
clazz- the class- Returns:
- the implementation
-
loadSingle
Loads the first implementation of the given class. The loaded implementation may request theCdsRuntimethroughCdsRuntimeAware.- Type Parameters:
T- the type- Parameters:
clazz- the classruntime- theCdsRuntime- Returns:
- the implementation, initialized with the
CdsRuntime
-