|
Tuscany Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tuscany.core.context.impl.AbstractLifecycle org.apache.tuscany.core.context.scope.CompositeScopeContext
public class CompositeScopeContext
Manages the lifecycle of composite component contexts, i.e. contexts which contain child contexts
CompositeContext
Field Summary |
---|
Fields inherited from class org.apache.tuscany.core.context.impl.AbstractLifecycle |
---|
lifecycleState, name |
Fields inherited from interface org.apache.tuscany.core.context.Lifecycle |
---|
CONFIG_ERROR, ERROR, INITIALIZED, INITIALIZING, RUNNING, STARTED, STOPPED, STOPPING, UNINITIALIZED |
Constructor Summary | |
---|---|
CompositeScopeContext(EventContext eventContext)
|
Method Summary | |
---|---|
Context |
getContext(java.lang.String ctxName)
Returns a context bound to the given name or null if the component does not exist. |
Context |
getContextByKey(java.lang.String ctxName,
java.lang.Object key)
Returns a context bound to the given name and scoped to the given key or null if the context does not exist |
java.lang.Object |
getInstance(QualifiedName qName)
|
boolean |
isCacheable()
Returns whether implementation instances may be held for the duration of an wire |
void |
onEvent(Event event)
|
void |
registerFactories(java.util.List<ContextFactory<Context>> configurations)
Registers the context factory used to construct instance contexts for the scope |
void |
registerFactory(ContextFactory<Context> configuration)
Adds a context factory to the scope |
void |
removeContext(java.lang.String ctxName)
Removes a context with the given name, determining the scope key from the thread context |
void |
removeContextByKey(java.lang.String ctxName,
java.lang.Object key)
Removes a context bound to the given name and scope key |
void |
start()
Starts the Lifecycle. |
void |
stop()
Stops the Lifecycle. |
Methods inherited from class org.apache.tuscany.core.context.impl.AbstractLifecycle |
---|
addListener, addListener, getLifecycleState, getListeners, getName, publish, removeListener, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.tuscany.core.context.Lifecycle |
---|
getLifecycleState, getName, setName |
Constructor Detail |
---|
public CompositeScopeContext(EventContext eventContext)
Method Detail |
---|
public void start() throws ScopeInitializationException
Lifecycle
start
in interface Lifecycle
ScopeInitializationException
public void stop() throws ScopeRuntimeException
Lifecycle
stop
in interface Lifecycle
ScopeRuntimeException
public void registerFactories(java.util.List<ContextFactory<Context>> configurations)
ScopeContext
registerFactories
in interface ScopeContext
public void registerFactory(ContextFactory<Context> configuration)
ScopeContext
registerFactory
in interface ScopeContext
public boolean isCacheable()
ScopeContext
isCacheable
in interface ScopeContext
public java.lang.Object getInstance(QualifiedName qName) throws TargetException
getInstance
in interface ScopeContext
TargetException
public Context getContext(java.lang.String ctxName)
ScopeContext
getContext
in interface ScopeContext
public Context getContextByKey(java.lang.String ctxName, java.lang.Object key)
ScopeContext
getContextByKey
in interface ScopeContext
public void removeContext(java.lang.String ctxName) throws ScopeRuntimeException
ScopeContext
removeContext
in interface ScopeContext
ScopeRuntimeException
public void removeContextByKey(java.lang.String ctxName, java.lang.Object key) throws ScopeRuntimeException
ScopeContext
removeContextByKey
in interface ScopeContext
ScopeRuntimeException
public void onEvent(Event event)
onEvent
in interface RuntimeEventListener
|
Tuscany Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |