diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-29 06:44:22 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-29 06:44:22 +0000 |
commit | fcef778b4fb5b4ee7d828c1e9cfb62af2d48d869 (patch) | |
tree | 3037a45c5b4fec2e94c20da66a695951dd7b8584 /branches/sca-equinox/modules/contribution-resource | |
parent | b732557ce29c5cc982957861dfb698a66d4a3e18 (diff) |
Fixed monitor module to avoid having to export monitor implementation classes. Removed dependencies on monitor-logging.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@700000 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
4 files changed, 10 insertions, 12 deletions
diff --git a/branches/sca-equinox/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java b/branches/sca-equinox/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java index 68d5d4761e..e72b66afce 100644 --- a/branches/sca-equinox/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java +++ b/branches/sca-equinox/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java @@ -27,7 +27,6 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; -import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl; import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.resolver.ModelResolver; @@ -39,6 +38,7 @@ import org.apache.tuscany.sca.contribution.service.ContributionWriteException; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; import org.apache.tuscany.sca.monitor.Problem.Severity; +import org.apache.tuscany.sca.monitor.impl.ProblemImpl; /** * Artifact processor for Resource export @@ -68,7 +68,7 @@ public class ResourceExportProcessor implements StAXArtifactProcessor<ResourceEx */ private void error(String message, Object model, Object... messageParameters) { if (monitor != null) { - Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters); + Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters); monitor.problem(problem); } } diff --git a/branches/sca-equinox/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java b/branches/sca-equinox/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java index 8b2fc44a1c..8b8b5e996e 100644 --- a/branches/sca-equinox/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java +++ b/branches/sca-equinox/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java @@ -27,7 +27,6 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; -import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl; import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.resolver.ModelResolver; @@ -39,6 +38,7 @@ import org.apache.tuscany.sca.contribution.service.ContributionWriteException; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; import org.apache.tuscany.sca.monitor.Problem.Severity; +import org.apache.tuscany.sca.monitor.impl.ProblemImpl; /** * Artifact processor for Namespace import @@ -70,7 +70,7 @@ public class ResourceImportProcessor implements StAXArtifactProcessor<ResourceI */ private void error(String message, Object model, Object... messageParameters) { if (monitor != null) { - Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters); + Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters); monitor.problem(problem); } } diff --git a/branches/sca-equinox/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java b/branches/sca-equinox/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java index ea44cb506b..371af3ae54 100644 --- a/branches/sca-equinox/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java +++ b/branches/sca-equinox/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java @@ -34,11 +34,10 @@ import org.apache.tuscany.sca.contribution.resource.ResourceExport; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.DefaultMonitorFactory; 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.impl.DefaultMonitorFactoryImpl; -import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl; /** * Test NamespaceExportProcessorTestCase @@ -65,7 +64,7 @@ public class ResourceExportProcessorTestCase extends TestCase { inputFactory = XMLInputFactory.newInstance(); // Create a monitor UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); - MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl(); + MonitorFactory monitorFactory = new DefaultMonitorFactory(); if (monitorFactory != null) { monitor = monitorFactory.createMonitor(); utilities.addUtility(monitorFactory); @@ -97,7 +96,7 @@ public class ResourceExportProcessorTestCase extends TestCase { assertTrue(true); }*/ staxProcessor.read(reader); - Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastLoggedProblem(); assertNotNull(problem); assertEquals("AttributeURIMissing", problem.getMessageId()); } diff --git a/branches/sca-equinox/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java b/branches/sca-equinox/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java index 1ff931c162..42ca5709d2 100644 --- a/branches/sca-equinox/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java +++ b/branches/sca-equinox/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java @@ -35,11 +35,10 @@ import org.apache.tuscany.sca.contribution.resource.ResourceImport; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.DefaultMonitorFactory; 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.impl.DefaultMonitorFactoryImpl; -import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl; /** * Test NamespaceImportProcessorTestCase @@ -66,7 +65,7 @@ public class ResourceImportProcessorTestCase extends TestCase { inputFactory = XMLInputFactory.newInstance(); // Create a monitor UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); - MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl(); + MonitorFactory monitorFactory = new DefaultMonitorFactory(); if (monitorFactory != null) { monitor = monitorFactory.createMonitor(); utilities.addUtility(monitorFactory); @@ -99,7 +98,7 @@ public class ResourceImportProcessorTestCase extends TestCase { assertTrue(true); }*/ staxProcessor.read(reader); - Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem(); + Problem problem = monitor.getLastLoggedProblem(); assertNotNull(problem); assertEquals("AttributeURIMissing", problem.getMessageId()); } |