Class ServerRuntime
java.lang.Object
org.apache.cayenne.runtime.CayenneRuntime
org.apache.cayenne.configuration.server.ServerRuntime
Deprecated, for removal: This API element is subject to removal in a future version.
Object representing Cayenne stack. Serves as an entry point to Cayenne for user applications and a factory of ObjectContexts.
Implementation is a thin wrapper of the dependency injection container.
The "Server" prefix in the name is in contrast to ROP "client" (that is started via ClientRuntime). So ServerRuntime is the default Cayenne stack that you should be using in all apps with the exception of client-side ROP.
- Since:
- 3.1
-
Field Summary
Fields inherited from class CayenneRuntime
injector, modules, threadInjectorModifier and TypeFieldDescriptionprotected final Injectorprotected final Collection<Module> protected static final ThreadLocal<Injector> A holder of an Injector bound to the current thread. -
Method Summary
Modifier and TypeMethodDescriptionstatic CayenneRuntimeBuilderbuilder()Deprecated, for removal: This API element is subject to removal in a future version.since 5.0, useCayenneRuntime.builder()insteadstatic CayenneRuntimeBuilderDeprecated, for removal: This API element is subject to removal in a future version.since 5.0, useCayenneRuntime.builder(String)insteadMethods inherited from class CayenneRuntime
bindThreadInjector, getChannel, getDataDomain, getDataSource, getDataSource, getInjector, getModules, getThreadInjector, newContext, newContext, performInTransaction, performInTransaction, performInTransaction, performInTransaction, shutdownModifier and TypeMethodDescriptionstatic voidbindThreadInjector(Injector injector) Binds a DIInjectorbound to the current thread.Returns the runtimeDataChannel.Returns the main runtime DataDomain.Returns a default DataSource for this runtime.getDataSource(String dataNodeName) Provides access to the JDBC DataSource assigned to a given DataNode.Returns DI injector used by this runtime.Returns the collection of modules used to initialize this runtime.static InjectorReturns theInjectorbound to the current thread.Returns a new ObjectContext instance based on the runtime's main DataChannel.newContext(DataChannel parentChannel) Returns a new ObjectContext which is a child of the specified DataChannel.<T> TRuns provided operation wrapped in a single transaction.<T> TperformInTransaction(TransactionalOperation<T> op, TransactionDescriptor descriptor) Runs provided operation wrapped in a single transaction.<T> TperformInTransaction(TransactionalOperation<T> op, TransactionListener callback) Runs provided operation wrapped in a single transaction.<T> TperformInTransaction(TransactionalOperation<T> op, TransactionListener callback, TransactionDescriptor descriptor) Runs provided operation wrapped in a single transaction.voidshutdown()Shuts down the DI injector of this runtime, giving all services that need to release some resources a chance to do that.
-
Method Details
-
builder
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0, useCayenneRuntime.builder()insteadCreates a builder of CayenneRuntime.- Returns:
- a builder of CayenneRuntime.
- Since:
- 4.0
-
builder
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0, useCayenneRuntime.builder(String)insteadCreates a builder of CayenneRuntime.- Parameters:
name- optional symbolic name of the created runtime.- Returns:
- a named builder of CayenneRuntime.
-
CayenneRuntimeclass instead