public abstract class CayenneRuntime extends Object
Injector
.Modifier and Type | Field and Description |
---|---|
protected Injector |
injector |
protected Module |
module |
protected static ThreadLocal<Injector> |
threadInjector
A holder of an Injector bound to the current thread.
|
Constructor and Description |
---|
CayenneRuntime(Module module)
Creates a CayenneRuntime with configuration based on the supplied array
of DI modules.
|
Modifier and Type | Method and Description |
---|---|
static void |
bindThreadInjector(Injector injector)
Binds a DI
Injector bound to the current thread. |
DataChannel |
getChannel()
Returns the runtime
DataChannel . |
ObjectContext |
getContext()
Deprecated.
since 3.1 use better named
newContext() instead. |
ObjectContext |
getContext(DataChannel parentChannel)
Deprecated.
since 3.1 use better named
newContext(DataChannel)
instead. |
Injector |
getInjector()
Returns DI injector used by this runtime.
|
Module |
getModule()
Returns the module used to initialize this runtime.
|
Module[] |
getModules()
Deprecated.
since 4.0. We only keep one module now, so use
getModule() . |
static Injector |
getThreadInjector()
Returns the
Injector bound to the current thread. |
ObjectContext |
newContext()
Returns a new ObjectContext instance based on the runtime's main
DataChannel.
|
ObjectContext |
newContext(DataChannel parentChannel)
Returns a new ObjectContext which is a child of the specified
DataChannel.
|
void |
shutdown()
Shuts down the DI injector of this runtime, giving all services that need
to release some resources a chance to do that.
|
protected static final ThreadLocal<Injector> threadInjector
protected Injector injector
protected Module module
public CayenneRuntime(Module module)
public static void bindThreadInjector(Injector injector)
Injector
bound to the current thread. It is primarily
intended for deserialization of ObjectContexts.public static Injector getThreadInjector()
Injector
bound to the current thread. Will return
null if none is bound.@Deprecated public Module[] getModules()
getModule()
.public Module getModule()
public Injector getInjector()
@BeforeScopeEnd public void shutdown()
public DataChannel getChannel()
DataChannel
.public ObjectContext newContext()
public ObjectContext newContext(DataChannel parentChannel)
@Deprecated public ObjectContext getContext()
newContext()
instead.@Deprecated public ObjectContext getContext(DataChannel parentChannel)
newContext(DataChannel)
instead.Copyright © 2001–2015 Apache Cayenne. All rights reserved.