Package com.sap.cds.services.runtime
Interface CdsRuntimeConfigurer
public interface CdsRuntimeConfigurer
-
Method Summary
Modifier and TypeMethodDescriptioncdsModel()
Sets the default CDS model on theCdsRuntime
of thisCdsRuntimeConfigurer
cdsModel
(com.sap.cds.reflect.CdsModel model) Sets the CDS model from the specified CSN file path on theCdsRuntime
of thisCdsRuntimeConfigurer
complete()
Completes theCdsRuntimeConfigurer
to prevent any further modifications of theCdsRuntime
configuration
(CdsRuntimeConfiguration configuration) Adds a givenCdsRuntimeConfiguration
to theCdsRuntimeConfigurer
.static CdsRuntimeConfigurer
create()
Creates a newCdsRuntimeConfigurer
.static CdsRuntimeConfigurer
create
(PropertiesProvider propertiesProvider) Creates a newCdsRuntimeConfigurer
with the givenPropertiesProvider
.environment
(ApplicationInfoProvider provider) environment
(ServiceBindingProvider provider) Applies all environment configuration modules to theCdsRuntime
of thisCdsRuntimeConfigurer
eventHandler
(Class<T> handlerClass, Supplier<T> handlerFactory) Registers an event handler class with theCdsRuntime
, given a factory to create instances of the event handlereventHandler
(Object handler) Registers an event handler instance with theCdsRuntime
.Applies all event handler configuration modules to theCdsRuntime
of thisCdsRuntimeConfigurer
TheCdsRuntime
that is configured by thisCdsRuntimeConfigurer
.packageScan
(String packageName) Scans the given package for event handler classes and registers them on theCdsRuntime
provider
(LocalizedMessageProvider provider) provider
(AuthenticationInfoProvider provider) provider
(CdsModelProvider provider) provider
(FeatureTogglesInfoProvider provider) provider
(ParameterInfoProvider provider) provider
(UserInfoProvider provider) Applies all provider configuration modules to theCdsRuntime
of thisCdsRuntimeConfigurer
Applies all service configuration modules to theCdsRuntime
of thisCdsRuntimeConfigurer
-
Method Details
-
create
Creates a newCdsRuntimeConfigurer
. In addition it automatically adds allCdsRuntimeConfiguration
modules registered throughExtendedServiceLoader
mechanisms.- Returns:
- the
CdsRuntimeConfigurer
-
create
Creates a newCdsRuntimeConfigurer
with the givenPropertiesProvider
. In addition it automatically adds allCdsRuntimeConfiguration
modules registered throughExtendedServiceLoader
mechanisms.- Returns:
- the
CdsRuntimeConfigurer
-
getCdsRuntime
CdsRuntime getCdsRuntime()TheCdsRuntime
that is configured by thisCdsRuntimeConfigurer
. It can be retrieved at any time, although it might get enriched by subsequent calls to thisCdsRuntimeConfigurer
.- Returns:
- the
CdsRuntime
-
configuration
Adds a givenCdsRuntimeConfiguration
to theCdsRuntimeConfigurer
. This configuration will be applied in parts, when the respective bulk operations are triggered, for exampleserviceConfigurations()
oreventHandlerConfigurations()
- Parameters:
configuration
- theCdsRuntimeConfiguration
- Returns:
- the
CdsRuntimeConfigurer
-
environmentConfigurations
CdsRuntimeConfigurer environmentConfigurations()Applies all environment configuration modules to theCdsRuntime
of thisCdsRuntimeConfigurer
- Returns:
- the
CdsRuntimeConfigurer
-
environment
- Parameters:
provider
- theServiceBindingProvider
- Returns:
- the
CdsRuntimeConfigurer
-
environment
- Parameters:
provider
- theApplicationInfoProvider
- Returns:
- the
CdsRuntimeConfigurer
-
cdsModel
CdsRuntimeConfigurer cdsModel()Sets the default CDS model on theCdsRuntime
of thisCdsRuntimeConfigurer
- Returns:
- the
CdsRuntimeConfigurer
-
cdsModel
Sets the CDS model from the specified CSN file path on theCdsRuntime
of thisCdsRuntimeConfigurer
- Parameters:
csnPath
- the CSN file path- Returns:
- the
CdsRuntimeConfigurer
-
cdsModel
- Parameters:
model
- theCdsModel
- Returns:
- the
CdsRuntimeConfigurer
-
serviceConfigurations
CdsRuntimeConfigurer serviceConfigurations()Applies all service configuration modules to theCdsRuntime
of thisCdsRuntimeConfigurer
- Returns:
- the
CdsRuntimeConfigurer
-
service
- Parameters:
service
- theService
- Returns:
- the
CdsRuntimeConfigurer
-
eventHandlerConfigurations
CdsRuntimeConfigurer eventHandlerConfigurations()Applies all event handler configuration modules to theCdsRuntime
of thisCdsRuntimeConfigurer
- Returns:
- the
CdsRuntimeConfigurer
-
eventHandler
Registers an event handler instance with theCdsRuntime
.- Parameters:
handler
- the event handler instance- Returns:
- the
CdsRuntimeConfigurer
-
eventHandler
Registers an event handler class with theCdsRuntime
, given a factory to create instances of the event handler- Type Parameters:
T
- the event handler type- Parameters:
handlerClass
- the event handler classhandlerFactory
- the supplier for instances of the event handler- Returns:
- the
CdsRuntimeConfigurer
-
packageScan
Scans the given package for event handler classes and registers them on theCdsRuntime
- Parameters:
packageName
- the name of the package- Returns:
- the
CdsRuntimeConfigurer
- Throws:
IOException
- if the classes of the package can't be loaded from the classpath
-
providerConfigurations
CdsRuntimeConfigurer providerConfigurations()Applies all provider configuration modules to theCdsRuntime
of thisCdsRuntimeConfigurer
- Returns:
- the
CdsRuntimeConfigurer
-
provider
- Parameters:
provider
- theCdsModelProvider
- Returns:
- the
CdsRuntimeConfigurer
-
provider
- Parameters:
provider
- theAuthenticationInfoProvider
- Returns:
- the
CdsRuntimeConfigurer
-
provider
- Parameters:
provider
- theUserInfoProvider
- Returns:
- the
CdsRuntimeConfigurer
-
provider
- Parameters:
provider
- theParameterInfoProvider
- Returns:
- the
CdsRuntimeConfigurer
-
provider
- Parameters:
provider
- theFeatureTogglesInfoProvider
- Returns:
- the
CdsRuntimeConfigurer
-
provider
- Parameters:
provider
- theLocalizedMessageProvider
- Returns:
- the
CdsRuntimeConfigurer
-
complete
CdsRuntime complete()Completes theCdsRuntimeConfigurer
to prevent any further modifications of theCdsRuntime
- Returns:
- the
CdsRuntime
in its final state
-