Package com.sap.cds.services.runtime
Interface CdsRuntimeConfigurer
public interface CdsRuntimeConfigurer
-
Method Summary
Modifier and TypeMethodDescriptioncdsModel()Sets the default CDS model on theCdsRuntimeof thisCdsRuntimeConfigurercdsModel(com.sap.cds.reflect.CdsModel model) Sets the CDS model from the specified CSN file path on theCdsRuntimeof thisCdsRuntimeConfigurercomplete()Completes theCdsRuntimeConfigurerto prevent any further modifications of theCdsRuntimeconfiguration(CdsRuntimeConfiguration configuration) Adds a givenCdsRuntimeConfigurationto theCdsRuntimeConfigurer.static CdsRuntimeConfigurercreate()Creates a newCdsRuntimeConfigurer.static CdsRuntimeConfigurercreate(PropertiesProvider propertiesProvider) Creates a newCdsRuntimeConfigurerwith the givenPropertiesProvider.environment(ApplicationInfoProvider provider) environment(ServiceBindingProvider provider) Applies all environment configuration modules to theCdsRuntimeof thisCdsRuntimeConfigurereventHandler(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 theCdsRuntimeof thisCdsRuntimeConfigurerTheCdsRuntimethat is configured by thisCdsRuntimeConfigurer.packageScan(String packageName) Scans the given package for event handler classes and registers them on theCdsRuntimeprovider(LocalizedMessageProvider provider) provider(AuthenticationInfoProvider provider) provider(CdsModelProvider provider) provider(CdsProvider<?> provider) provider(FeatureTogglesInfoProvider provider) provider(ParameterInfoProvider provider) provider(UserInfoProvider provider) Applies all provider configuration modules to theCdsRuntimeof thisCdsRuntimeConfigurerApplies all service configuration modules to theCdsRuntimeof thisCdsRuntimeConfigurer
-
Method Details
-
create
Creates a newCdsRuntimeConfigurer.In addition it automatically adds all
CdsRuntimeConfigurationmodules registered throughExtendedServiceLoadermechanisms.- Returns:
- the
CdsRuntimeConfigurer
-
create
Creates a newCdsRuntimeConfigurerwith the givenPropertiesProvider.In addition it automatically adds all
CdsRuntimeConfigurationmodules registered throughExtendedServiceLoadermechanisms.- Returns:
- the
CdsRuntimeConfigurer
-
getCdsRuntime
CdsRuntime getCdsRuntime()TheCdsRuntimethat 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 givenCdsRuntimeConfigurationto 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 theCdsRuntimeof 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 theCdsRuntimeof thisCdsRuntimeConfigurer- Returns:
- the
CdsRuntimeConfigurer
-
cdsModel
Sets the CDS model from the specified CSN file path on theCdsRuntimeof 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 theCdsRuntimeof thisCdsRuntimeConfigurer- Returns:
- the
CdsRuntimeConfigurer
-
service
- Parameters:
service- theService- Returns:
- the
CdsRuntimeConfigurer
-
eventHandlerConfigurations
CdsRuntimeConfigurer eventHandlerConfigurations()Applies all event handler configuration modules to theCdsRuntimeof 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 theCdsRuntimeof 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
-
provider
- Parameters:
provider- theCdsProvider- Returns:
- the
CdsRuntimeConfigurer
-
complete
CdsRuntime complete()Completes theCdsRuntimeConfigurerto prevent any further modifications of theCdsRuntime- Returns:
- the
CdsRuntimein its final state
-