diff options
Diffstat (limited to 'sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/DeployedComposite.java')
-rw-r--r-- | sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/DeployedComposite.java | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/DeployedComposite.java b/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/DeployedComposite.java index 4f6f3f8b9f..0ac3162122 100644 --- a/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/DeployedComposite.java +++ b/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/DeployedComposite.java @@ -26,19 +26,19 @@ import java.util.List; import javax.xml.namespace.QName;
import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
import org.apache.tuscany.sca.context.CompositeContext;
import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.deployment.Deployer;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
+import org.apache.tuscany.sca.monitor.ValidationException;
import org.apache.tuscany.sca.runtime.ActivationException;
import org.apache.tuscany.sca.runtime.CompositeActivator;
import org.apache.tuscany.sca.runtime.EndpointRegistry;
-import org.oasisopen.sca.ServiceRuntimeException;
public class DeployedComposite {
@@ -73,12 +73,12 @@ public class DeployedComposite { this.extensionPointRegistry = extensionPointRegistry;
try {
init();
- } catch (Throwable e) {
- throw new RuntimeException(e);
+ } catch (Exception e) {
+ throw new ActivationException(e);
}
}
- protected void init() throws Throwable {
+ protected void init() throws ValidationException, ContributionResolveException, CompositeBuilderException, ActivationException {
List<Contribution> contribution = new ArrayList<Contribution>();
contribution.add(installedContribution.getContribution());
@@ -90,7 +90,7 @@ public class DeployedComposite { try {
domainComposite = deployer.build(contribution, dependedOnContributions, new HashMap<QName, List<String>>(), monitor);
- analyzeProblems(monitor);
+ monitor.analyzeProblems();
} finally {
monitorFactory.setContextMonitor(tcm);
@@ -138,23 +138,4 @@ public class DeployedComposite { // shouldn't ever happen
throw new IllegalStateException("can't determine composte uri");
}
-
- /**
- * // TODO: this method should be on the Monitor class
- */
- protected void analyzeProblems(Monitor monitor) throws Throwable {
- try {
- for (Problem problem : monitor.getProblems()) {
- if ((problem.getSeverity() == Severity.ERROR)) {
- if (problem.getCause() != null) {
- throw problem.getCause();
- } else {
- throw new ServiceRuntimeException(problem.toString());
- }
- }
- }
- } finally {
- monitor.reset();
- }
- }
}
|