summaryrefslogtreecommitdiffstats
path: root/branches/sca-equinox/modules/contribution-namespace
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-29 06:44:22 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-29 06:44:22 +0000
commitfcef778b4fb5b4ee7d828c1e9cfb62af2d48d869 (patch)
tree3037a45c5b4fec2e94c20da66a695951dd7b8584 /branches/sca-equinox/modules/contribution-namespace
parentb732557ce29c5cc982957861dfb698a66d4a3e18 (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 'branches/sca-equinox/modules/contribution-namespace')
-rw-r--r--branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java4
-rw-r--r--branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java4
-rw-r--r--branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java7
-rw-r--r--branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java8
4 files changed, 10 insertions, 13 deletions
diff --git a/branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java b/branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java
index 64862301c1..d3a2f41f85 100644
--- a/branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.java
+++ b/branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessor.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.namespace.NamespaceExport;
import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
@@ -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 export
@@ -68,7 +68,7 @@ public class NamespaceExportProcessor implements StAXArtifactProcessor<Namespace
*/
private void error(String message, Object model, Object... messageParameters) {
if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-namespace-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+ Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-namespace-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
monitor.problem(problem);
}
}
diff --git a/branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java b/branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java
index 829e5fa43f..d047ca5109 100644
--- a/branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java
+++ b/branches/sca-equinox/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.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.namespace.NamespaceImport;
import org.apache.tuscany.sca.contribution.namespace.NamespaceImportExportFactory;
@@ -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 NamespaceImportProcessor implements StAXArtifactProcessor<Namespac
*/
private void error(String message, Object model, Object... messageParameters) {
if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "contribution-namespace-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+ Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-namespace-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
monitor.problem(problem);
}
}
diff --git a/branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java b/branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
index 1f508d6a4a..b11933fbef 100644
--- a/branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
+++ b/branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
@@ -33,11 +33,10 @@ import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtens
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
@@ -64,7 +63,7 @@ public class NamespaceExportProcessorTestCase 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);
@@ -96,7 +95,7 @@ public class NamespaceExportProcessorTestCase extends TestCase {
assertTrue(true);
}*/
staxProcessor.read(reader);
- Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+ Problem problem = monitor.getLastLoggedProblem();
assertNotNull(problem);
assertEquals("AttributeNameSpaceMissing", problem.getMessageId());
}
diff --git a/branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java b/branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java
index 71ac33bf68..282c0cfbe7 100644
--- a/branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java
+++ b/branches/sca-equinox/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessorTestCase.java
@@ -32,15 +32,13 @@ import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
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
@@ -67,7 +65,7 @@ public class NamespaceImportProcessorTestCase 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);
@@ -101,7 +99,7 @@ public class NamespaceImportProcessorTestCase extends TestCase {
assertTrue(true);
}*/
staxProcessor.read(reader);
- Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+ Problem problem = monitor.getLastLoggedProblem();
assertNotNull(problem);
assertEquals("AttributeNameSpaceMissing", problem.getMessageId());
}