|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
KEY
- the type of IDs that this container uses to identify its contexts.
For example, for COMPOSITE scope this could be the URI of the composite component,
or for HTTP Session scope it might be the HTTP session ID.public interface ScopeContainer<KEY>
Manages the lifecycle and visibility of instances associated with a an RuntimeComponent
.
Field Summary | |
---|---|
static int |
CONFIG_ERROR
|
static int |
ERROR
|
static int |
INITIALIZED
|
static int |
INITIALIZING
|
static int |
RUNNING
|
static int |
STOPPED
|
static int |
STOPPING
|
static int |
UNINITIALIZED
|
Method Summary | |
---|---|
void |
addWrapperReference(KEY existingContextId,
KEY newContextId)
Allows a component to be registered against more than one context id. |
InstanceWrapper |
getAssociatedWrapper(KEY contextId)
Returns an implementation instance associated with the current scope context. |
int |
getLifecycleState()
Returns the lifecycle state |
Scope |
getScope()
Returns the Scope that this container supports. |
InstanceWrapper |
getWrapper(KEY contextId)
Returns an instance wrapper associated with the current scope context, creating one if necessary |
void |
registerWrapper(InstanceWrapper wrapper,
KEY contextId)
Register an existing instance against a context id. |
void |
remove(KEY contextId)
Removes an identified component implementation instance associated with the current context from persistent storage |
void |
returnWrapper(InstanceWrapper wrapper,
KEY contextId)
Return a wrapper after use (for example, after invoking the instance). |
void |
start()
Starts the Lifecycle. |
void |
startContext(KEY contextId)
Start a new context with the supplied ID. |
void |
stop()
Stops the Lifecycle. |
void |
stopContext(KEY contextId)
Stop the context with the supplied ID. |
Methods inherited from interface org.apache.tuscany.sca.event.RuntimeEventListener |
---|
onEvent |
Field Detail |
---|
static final int CONFIG_ERROR
static final int UNINITIALIZED
static final int INITIALIZING
static final int INITIALIZED
static final int RUNNING
static final int STOPPING
static final int STOPPED
static final int ERROR
Method Detail |
---|
Scope getScope()
void startContext(KEY contextId)
contextId
- an ID that uniquely identifies the context.void stopContext(KEY contextId)
contextId
- an ID that uniquely identifies the context.InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException
contextId
- the id for the scope context
TargetResolutionException
- if there was a problem instantiating the target instancevoid addWrapperReference(KEY existingContextId, KEY newContextId) throws TargetResolutionException
existingContextId
- an id that identifies an existing component instancenewContextId
- a new id against which this component will also be registered
TargetResolutionException
void registerWrapper(InstanceWrapper wrapper, KEY contextId) throws TargetResolutionException
wrapper
- the instance wrapper for the instance to be registeredcontextId
- the id for the scope context
TargetResolutionException
InstanceWrapper getAssociatedWrapper(KEY contextId) throws TargetResolutionException
TargetNotFoundException
is thrown.
contextId
- the id for the scope context
TargetResolutionException
- if there was a problem instantiating the target instancevoid returnWrapper(InstanceWrapper wrapper, KEY contextId) throws TargetDestructionException
wrapper
- the wrapper for the target instance being returnedcontextId
- the id for the scope context
TargetDestructionException
- if there was a problem returning the target instancevoid remove(KEY contextId) throws TargetDestructionException
contextId
- the identifier of the context to remove.
TargetDestructionException
int getLifecycleState()
UNINITIALIZED
,
INITIALIZING
,
INITIALIZED
,
RUNNING
,
STOPPING
,
STOPPED
void start()
void stop()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |