diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-06-10 08:08:21 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-06-10 08:08:21 +0000 |
commit | d4840d38ef37787333f4c2dbf95043d1fbad9c93 (patch) | |
tree | 2600d372946d33ded09d9e0a0fe50bcc1983626b /sca-java-2.x/trunk/modules/domain-node/src/main/java | |
parent | fb9bf6845595286c631086e32fb2505c06bdd926 (diff) |
TUSCANY-3867 - If an exception is detected at start time tidy up by stopping what's been started.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1134224 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/main/java')
-rw-r--r-- | sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java index 7eba965b1a..21d20ff6a1 100644 --- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java +++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java @@ -98,9 +98,17 @@ public class DeployedComposite { } public void start() throws ActivationException { - compositeActivator.activate(compositeContext, builtComposite); - compositeActivator.start(compositeContext, builtComposite); - domainRegistry.addRunningComposite(contribution.getURI(), builtComposite); + try { + compositeActivator.activate(compositeContext, builtComposite); + compositeActivator.start(compositeContext, builtComposite); + domainRegistry.addRunningComposite(contribution.getURI(), builtComposite); + } catch (ActivationException ex){ + stop(); + throw ex; + } catch (Exception ex){ + stop(); + throw new ActivationException(ex); + } } public void stop() throws ActivationException { |