public interface CdsRuntimeBuilder
CdsRuntime
.
For everything that needs to be handled framework specifically an abstraction should be present in the builder.Modifier and Type | Interface and Description |
---|---|
static interface |
CdsRuntimeBuilder.ResourceProvider<R>
A provider for resources which can throw an
Exception during
creation. |
static CdsRuntimeBuilder builder()
CdsRuntimeBuilder withCdsModel(CdsRuntimeBuilder.ResourceProvider<com.sap.cds.reflect.CdsModel> provider)
CdsModel
.provider
- The providerCdsRuntimeBuilder
CdsRuntimeBuilder withTransactionManagerFactory(CdsRuntimeBuilder.ResourceProvider<TransactionManagerFactory> provider)
TransactionManagerFactory
.provider
- The providerCdsRuntimeBuilder
CdsRuntimeBuilder withCsnResource(String resourcePathToCSN)
CdsModel
to a resource path.resourcePathToCSN
- The resource path in current classloaderCdsRuntimeBuilder
CdsRuntimeBuilder withDataSource(CdsRuntimeBuilder.ResourceProvider<DataSource> provider)
DataSource
. A local
TransactionManagerFactory
will be added automatically.provider
- The providerCdsRuntimeBuilder
CdsRuntimeBuilder withDataSource(String dataSourceName)
DataSource
. A local
TransactionManagerFactory
will be added automatically.dataSourceName
- The name of the data sourceCdsRuntimeBuilder
<T> CdsRuntimeBuilder withHandlerClass(Class<T> handlerClass, Supplier<T> handlerSupplier)
T
- The type of the handler classhandlerClass
- A handler classhandlerSupplier
- A Supplier
for the handler class typeCdsRuntimeBuilder
CdsRuntimeBuilder withHandlerPackage(String packageName)
EventHandler
lookuppackageName
- The name of the packageCdsRuntimeBuilder
CdsRuntime build() throws Exception
CdsRuntime
instance based on the specified providers for
the model and DataSouce.CdsRuntime
instanceException
- In case the runtime instance could not be created due to
unexpected issues like IO problems.Copyright © 2019. All rights reserved.