|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.configuration.CayenneRuntime
public abstract class CayenneRuntime
A superclass of various Cayenne runtime stacks. A Runtime is the main access point to
Cayenne for a user application. It provides a default Cayenne configuration as well as
a way to customize this configuration via a built-in dependency injection (DI)
container. In fact implementation-wise, Runtime object is just a convenience thin
wrapper around a DI Injector
.
Field Summary | |
---|---|
protected Injector |
injector
|
protected Module[] |
modules
|
Constructor Summary | |
---|---|
CayenneRuntime(Collection<Module> modules)
Creates a CayenneRuntime with configuration based on the supplied collection of DI modules. |
|
CayenneRuntime(Module... modules)
Creates a CayenneRuntime with configuration based on the supplied array of DI modules. |
Method Summary | |
---|---|
DataChannel |
getChannel()
Returns the runtime DataChannel . |
ObjectContext |
getContext()
Returns an ObjectContext based on the runtime DataChannel. |
ObjectContext |
getContext(DataChannel parentChannel)
Returns an ObjectContext based on the runtime DataChannel. |
Injector |
getInjector()
Returns DI injector used by this runtime. |
Module[] |
getModules()
Returns an array of modules used to initialize this runtime. |
protected static Module[] |
mergeModules(Module mainModule,
Collection<Module> extraModules)
Internal helper method to add special extra modules in subclass constructors. |
protected static Module[] |
mergeModules(Module mainModule,
Module... extraModules)
Internal helper method to add special extra modules in subclass constructors. |
void |
shutdown()
Shuts down the DI injector of this runtime, giving all services that need to release some resources a chance to do that. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Injector injector
protected Module[] modules
Constructor Detail |
---|
public CayenneRuntime(Module... modules)
public CayenneRuntime(Collection<Module> modules)
Method Detail |
---|
protected static Module[] mergeModules(Module mainModule, Module... extraModules)
protected static Module[] mergeModules(Module mainModule, Collection<Module> extraModules)
public Module[] getModules()
public Injector getInjector()
@BeforeScopeEnd public void shutdown()
public DataChannel getChannel()
DataChannel
.
public ObjectContext getContext()
public ObjectContext getContext(DataChannel parentChannel)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |