tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r826637 - /tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java
Date Mon, 19 Oct 2009 11:10:30 GMT
Author: antelder
Date: Mon Oct 19 11:10:29 2009
New Revision: 826637

URL: http://svn.apache.org/viewvc?rev=826637&view=rev
Log:
Catch any exception during starting of a component and rethrow as ServiceUnavailableException

Modified:
    tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java

Modified: tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java?rev=826637&r1=826636&r2=826637&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java
(original)
+++ tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/impl/CompositeScopeContainer.java
Mon Oct 19 11:10:29 2009
@@ -25,6 +25,7 @@
 import org.apache.tuscany.sca.core.scope.TargetNotFoundException;
 import org.apache.tuscany.sca.core.scope.TargetResolutionException;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.oasisopen.sca.ServiceUnavailableException;
 
 /**
  * A scope context which manages atomic component instances keyed by composite
@@ -54,8 +55,12 @@
     @Override
     public synchronized InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException
{
         if (wrapper == null) {
-            wrapper = createInstanceWrapper();
-            wrapper.start();
+            try {
+                wrapper = createInstanceWrapper();
+                wrapper.start();
+            } catch (Exception e) {
+                throw new ServiceUnavailableException(e);
+            }
         }
         return wrapper;
     }



Mime
View raw message