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
-
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> T
loadSingle
(Class<T> clazz) Loads the first implementation of the given class.static <T> T
loadSingle
(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 theCdsRuntime
throughCdsRuntimeAware
.- 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 theCdsRuntime
throughCdsRuntimeAware
.- 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 theCdsRuntime
throughCdsRuntimeAware
.- 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 theCdsRuntime
throughCdsRuntimeAware
.- Type Parameters:
T
- the type- Parameters:
clazz
- the classruntime
- theCdsRuntime
- Returns:
- the implementation, initialized with the
CdsRuntime
-