2016/05/28 - Apache Tuscany has been retired.
For more information, please explore the Attic.
org.apache.tuscany.sca.core.scope
Class StatelessScopeContainer<KEY>
java.lang.Object
org.apache.tuscany.sca.core.scope.AbstractScopeContainer<KEY>
org.apache.tuscany.sca.core.scope.StatelessScopeContainer<KEY>
- All Implemented Interfaces:
- java.util.EventListener, ScopeContainer<KEY>, RuntimeEventListener
public class StatelessScopeContainer<KEY>
- extends AbstractScopeContainer<KEY>
A scope context which manages stateless atomic component instances in a non-pooled fashion.
| Methods inherited from class org.apache.tuscany.sca.core.scope.AbstractScopeContainer |
addWrapperReference, checkInit, createInstanceWrapper, getComponent, getLifecycleState, getScope, isEagerInit, onEvent, registerWrapper, remove, setComponent, setLifecycleState, start, startContext, stop, stopContext, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StatelessScopeContainer
public StatelessScopeContainer(RuntimeComponent component)
getWrapper
public InstanceWrapper getWrapper(KEY contextId)
throws TargetResolutionException
- Description copied from interface:
ScopeContainer
- Returns an instance wrapper associated with the current scope context, creating one if necessary
- Specified by:
getWrapper in interface ScopeContainer<KEY>- Overrides:
getWrapper in class AbstractScopeContainer<KEY>
- Parameters:
contextId - the id for the scope context
- Returns:
- the wrapper for the target instance
- Throws:
TargetResolutionException - if there was a problem instantiating the target instance
getAssociatedWrapper
public InstanceWrapper getAssociatedWrapper(KEY contextId)
throws TargetResolutionException
- Description copied from interface:
ScopeContainer
- Returns an implementation instance associated with the current scope context.
If no instance is found, a
TargetNotFoundException is thrown.
- Specified by:
getAssociatedWrapper in interface ScopeContainer<KEY>- Overrides:
getAssociatedWrapper in class AbstractScopeContainer<KEY>
- Parameters:
contextId - the id for the scope context
- Returns:
- the wrapper for the target instance
- Throws:
TargetResolutionException - if there was a problem instantiating the target instance
returnWrapper
public void returnWrapper(InstanceWrapper wrapper,
KEY contextId)
throws TargetDestructionException
- Description copied from interface:
ScopeContainer
- Return a wrapper after use (for example, after invoking the instance).
- Specified by:
returnWrapper in interface ScopeContainer<KEY>- Overrides:
returnWrapper in class AbstractScopeContainer<KEY>
- Parameters:
wrapper - the wrapper for the target instance being returnedcontextId - the id for the scope context
- Throws:
TargetDestructionException - if there was a problem returning the target instance