From 946292048c3c76c0fbc0d0f54fd52598bce6e305 Mon Sep 17 00:00:00 2001 From: nash Date: Sun, 13 Sep 2009 22:01:04 +0000 Subject: Copy r797997, r798040 and r798050 changes from 1.5.1 branch to 1.x branch git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@814393 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/node/impl/NodeImpl.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java') diff --git a/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index 7d64857306..4a93993560 100644 --- a/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java @@ -58,6 +58,7 @@ import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtens import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.contribution.resolver.ModelResolver; +import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.contribution.service.ContributionService; import org.apache.tuscany.sca.contribution.service.util.FileHelper; import org.apache.tuscany.sca.core.ExtensionPointRegistry; @@ -68,6 +69,7 @@ import org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation; import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.MonitorRuntimeException; import org.apache.tuscany.sca.monitor.Problem; import org.apache.tuscany.sca.monitor.Problem.Severity; import org.apache.tuscany.sca.node.SCAClient; @@ -140,6 +142,8 @@ public class NodeImpl implements SCANode, SCAClient { // Configure the node configureNode(configuration); + } catch (ServiceRuntimeException e) { + throw e; } catch (Exception e) { throw new ServiceRuntimeException(e); } @@ -376,6 +380,8 @@ public class NodeImpl implements SCANode, SCAClient { // Configure the node configureNode(configuration); + } catch (ServiceRuntimeException e) { + throw e; } catch (Exception e) { throw new ServiceRuntimeException(e); } @@ -440,6 +446,8 @@ public class NodeImpl implements SCANode, SCAClient { // Configure the node configureNode(configuration); + } catch (ServiceRuntimeException e) { + throw e; } catch (Exception e) { throw new ServiceRuntimeException(e); } @@ -584,7 +592,11 @@ public class NodeImpl implements SCANode, SCAClient { logger.log(Level.INFO, "Loading composite: " + compositeURL); // InputStream is = compositeURL.openStream(); // XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - composite = compositeDocProcessor.read(null, uri, compositeURL); + try { + composite = compositeDocProcessor.read(null, uri, compositeURL); + } catch (ContributionReadException e) { + // ignore - errors will be detected by analyzeProblems() call below + } // reader.close(); analyzeProblems(); @@ -696,9 +708,9 @@ public class NodeImpl implements SCANode, SCAClient { for (Problem problem : monitor.getProblems()) { if ((problem.getSeverity() == Severity.ERROR) && (!problem.getMessageId().equals("SchemaError"))) { if (problem.getCause() != null) { - throw problem.getCause(); + throw new ServiceRuntimeException(new MonitorRuntimeException(problem.getCause())); } else { - throw new ServiceRuntimeException(problem.toString()); + throw new ServiceRuntimeException(new MonitorRuntimeException(problem.toString())); } } } -- cgit v1.2.3