diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-26 22:38:57 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-26 22:38:57 +0000 |
commit | 6dd8d6a5652b2301a65f97dee17b5b0b9cfb038b (patch) | |
tree | a0e7039a9fe0b80bfc94443b6b87a8456811a853 /branches/sca-java-1.5.1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl | |
parent | 1558298f64038d66ab07b6d2d062aa8473d6bc48 (diff) |
Fix TUSCANY-3172 (domain manager doesn't report errors cleanly to the nodes)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@797997 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl')
-rw-r--r-- | branches/sca-java-1.5.1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/branches/sca-java-1.5.1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/branches/sca-java-1.5.1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java index 7d64857306..4a93993560 100644 --- a/branches/sca-java-1.5.1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java +++ b/branches/sca-java-1.5.1/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())); } } } |