diff options
Diffstat (limited to '')
-rw-r--r-- | java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java index 0639b8885b..1235fd2a67 100644 --- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java +++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/StatelessScopeContainer.java @@ -37,8 +37,10 @@ public class StatelessScopeContainer<KEY> extends AbstractScopeContainer<KEY> { } @Override - public InstanceWrapper getWrapper(KEY contextId) - throws TargetResolutionException { + public InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException { + if (lifecycleState != RUNNING) { + throw new TargetResolutionException("scope container not running, lifecycleState=" + lifecycleState); + } InstanceWrapper ctx = createInstanceWrapper(); ctx.start(); return ctx; |