|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.configuration.CayenneRuntime
org.apache.cayenne.configuration.server.ServerRuntime
public class ServerRuntime
An object representing Cayenne server-stack that connects directly to the
database via JDBC. This is an entry point for user applications to access
Cayenne, which encapsulates the dependency injection internals. The term
"server" is used as opposed to ROP "client" (see ClientRuntime
). Any
application, desktop, server, etc. that has a direct JDBC connection should
be using this runtime.
Field Summary |
---|
Fields inherited from class org.apache.cayenne.configuration.CayenneRuntime |
---|
injector, modules, threadInjector |
Constructor Summary | |
---|---|
ServerRuntime(String[] configurationLocations,
Module... extraModules)
Creates a server runtime configuring it with a standard set of services contained in ServerModule . |
|
ServerRuntime(String configurationLocation,
Module... extraModules)
Creates a server runtime configuring it with a standard set of services contained in ServerModule . |
Method Summary | ||
---|---|---|
DataDomain |
getDataDomain()
Returns the main runtime DataDomain. |
|
DataSource |
getDataSource(String dataNodeName)
Provides access to the JDBC DataSource assigned to a given DataNode. |
|
|
performInTransaction(TransactionalOperation<T> op)
Runs provided operation wrapped in a single transaction. |
Methods inherited from class org.apache.cayenne.configuration.CayenneRuntime |
---|
bindThreadInjector, getChannel, getContext, getContext, getInjector, getModules, getThreadInjector, mergeModules, mergeModules, newContext, newContext, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerRuntime(String configurationLocation, Module... extraModules)
ServerModule
. CayenneServerModule is created with
provided 'configurationLocation'. An optional array of extra modules may
contain service overrides and/or user services.
public ServerRuntime(String[] configurationLocations, Module... extraModules)
ServerModule
. CayenneServerModule is created with
one or more 'configurationLocations'. An optional array of extra modules
may contain service overrides and/or user services.
Method Detail |
---|
public <T> T performInTransaction(TransactionalOperation<T> op)
TransactionManager
. Nested
calls to 'performInTransaction' are safe and attached to the same
in-progress transaction. TransactionalOperation can be some arbitrary
user code, which most often than not will consist of multiple Cayenne
operations.
public DataDomain getDataDomain()
CayenneRuntime.getChannel()
. Although users may redefine DataChannel provider
in the DI registry, for instance to decorate this DataDomain with a
custom wrapper.
public DataSource getDataSource(String dataNodeName)
Normally Cayenne applications don't need to access DataSource or any other JDBC code directly, however in some unusual conditions it may be needed, and this method provides a shortcut to raw JDBC.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |