tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r657881 [5/9] - in /incubator/tuscany/java/sca: modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ modules/assembly-xml/src/main/resources/ modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ modules...
Date Mon, 19 May 2008 17:49:08 GMT
Modified: incubator/tuscany/java/sca/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-data-xml/src/main/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -1,132 +1,132 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.    
- */
-package org.apache.tuscany.sca.implementation.data;
-
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.data.engine.ConnectionInfoArtifactProcessor;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-
-
-/**
- * Implements a StAX artifact processor for DATA implementations.
- * 
- * The artifact processor is responsible for processing <implementation.data>
- * elements in SCA assembly XML composite files and populating the DATA
- * implementation model, resolving its references to other artifacts in the SCA
- * contribution, and optionally write the model back to SCA assembly XML.
- * 
- * @version $Rev$ $Date$
- */
-public class DATAImplementationProcessor implements StAXArtifactProcessor<DATAImplementation> {
-    protected static final QName IMPLEMENTATION_DATA_XML = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.xml");
-    
-    private DATAImplementationFactory dataFactory;
-    
-    private StAXArtifactProcessor<ConnectionInfo> connectionInfoProcessor;
-    
-    public DATAImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
-        AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
-        JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
-        
-        this.dataFactory = new DATAImplementationFactory(assemblyFactory, javaFactory);
-        
-        this.connectionInfoProcessor = new ConnectionInfoArtifactProcessor(modelFactories);
-    }
-
-    public QName getArtifactType() {
-        // Returns the qname of the XML element processed by this processor
-        return IMPLEMENTATION_DATA_XML;
-    }
-
-    public Class<DATAImplementation> getModelType() {
-        // Returns the type of model processed by this processor
-        return DATAImplementation.class;
-    }
-
-    /*
-     * <component name="CompanyDataComponent">
-     *   <implementation.data.xml>
-     *      <connectionInfo>
-     *         <connectionProperties 
-     *          driverClass="org.apache.derby.jdbc.EmbeddedDriver" 
-     *          databaseURL="jdbc:derby:target/test-classes/dastest; create = true" 
-     *          loginTimeout="600000"/>
-     *      </connectionInfo>
-     *   </implementation.data>
-     * </component>
-     */
-    public DATAImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-        assert IMPLEMENTATION_DATA_XML.equals(reader.getName());
-
-        // Read an <implementation.data.xml> element
-
-        // Create an initialize the DAS implementation model
-        DATAImplementation implementation = dataFactory.createDASImplementation();
-
-        while (true) {
-            int event = reader.next();
-            switch (event) {
-
-            case START_ELEMENT:
-                if (ConnectionInfoArtifactProcessor.CONNECTION_INFO.equals(reader.getName())) {
-                    
-                    // Read connection info
-                    ConnectionInfo connectionInfo = (ConnectionInfo) connectionInfoProcessor.read(reader);
-                    implementation.setConnectionInfo(connectionInfo);
-                }
-                break;
-            case XMLStreamConstants.END_ELEMENT:
-                if (IMPLEMENTATION_DATA_XML.equals(reader.getName())) {
-                    return implementation;
-                }                    
-                break;
-            }
-        }
-
-    }
-
-    public void resolve(DATAImplementation impl, ModelResolver resolver) throws ContributionResolveException {
-    }
-
-    public void write(DATAImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-        writer.writeStartElement(IMPLEMENTATION_DATA_XML.getNamespaceURI(), IMPLEMENTATION_DATA_XML.getLocalPart());
-                
-        if (implementation.getConnectionInfo() != null) { 
-            connectionInfoProcessor.write(implementation.getConnectionInfo(), writer);
-        }
-        
-        writer.writeEndElement();
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.sca.implementation.data;
+
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.data.engine.ConnectionInfoArtifactProcessor;
+import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+
+/**
+ * Implements a StAX artifact processor for DATA implementations.
+ * 
+ * The artifact processor is responsible for processing <implementation.data>
+ * elements in SCA assembly XML composite files and populating the DATA
+ * implementation model, resolving its references to other artifacts in the SCA
+ * contribution, and optionally write the model back to SCA assembly XML.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DATAImplementationProcessor implements StAXArtifactProcessor<DATAImplementation> {
+    protected static final QName IMPLEMENTATION_DATA_XML = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.xml");
+    
+    private DATAImplementationFactory dataFactory;
+    private Monitor monitor;
+    private StAXArtifactProcessor<ConnectionInfo> connectionInfoProcessor;
+    
+    public DATAImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+        AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+        JavaInterfaceFactory javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
+        this.monitor = monitor;
+        this.dataFactory = new DATAImplementationFactory(assemblyFactory, javaFactory);        
+        this.connectionInfoProcessor = new ConnectionInfoArtifactProcessor(modelFactories, this.monitor);        
+    }
+
+    public QName getArtifactType() {
+        // Returns the qname of the XML element processed by this processor
+        return IMPLEMENTATION_DATA_XML;
+    }
+
+    public Class<DATAImplementation> getModelType() {
+        // Returns the type of model processed by this processor
+        return DATAImplementation.class;
+    }
+
+    /*
+     * <component name="CompanyDataComponent">
+     *   <implementation.data.xml>
+     *      <connectionInfo>
+     *         <connectionProperties 
+     *          driverClass="org.apache.derby.jdbc.EmbeddedDriver" 
+     *          databaseURL="jdbc:derby:target/test-classes/dastest; create = true" 
+     *          loginTimeout="600000"/>
+     *      </connectionInfo>
+     *   </implementation.data>
+     * </component>
+     */
+    public DATAImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+        assert IMPLEMENTATION_DATA_XML.equals(reader.getName());
+
+        // Read an <implementation.data.xml> element
+
+        // Create an initialize the DAS implementation model
+        DATAImplementation implementation = dataFactory.createDASImplementation();
+
+        while (true) {
+            int event = reader.next();
+            switch (event) {
+
+            case START_ELEMENT:
+                if (ConnectionInfoArtifactProcessor.CONNECTION_INFO.equals(reader.getName())) {
+                    
+                    // Read connection info
+                    ConnectionInfo connectionInfo = (ConnectionInfo) connectionInfoProcessor.read(reader);
+                    implementation.setConnectionInfo(connectionInfo);
+                }
+                break;
+            case XMLStreamConstants.END_ELEMENT:
+                if (IMPLEMENTATION_DATA_XML.equals(reader.getName())) {
+                    return implementation;
+                }                    
+                break;
+            }
+        }
+
+    }
+
+    public void resolve(DATAImplementation impl, ModelResolver resolver) throws ContributionResolveException {
+    }
+
+    public void write(DATAImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+        writer.writeStartElement(IMPLEMENTATION_DATA_XML.getNamespaceURI(), IMPLEMENTATION_DATA_XML.getLocalPart());
+                
+        if (implementation.getConnectionInfo() != null) { 
+            connectionInfoProcessor.write(implementation.getConnectionInfo(), writer);
+        }
+        
+        writer.writeEndElement();
+    }
+}

Modified: incubator/tuscany/java/sca/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-data-xml/src/test/java/org/apache/tuscany/sca/implementation/data/DATAImplementationProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -1,131 +1,131 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.    
- */
-
-package org.apache.tuscany.sca.implementation.data;
-
-import java.io.StringReader;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-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.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
-import org.apache.tuscany.sca.data.engine.config.ConnectionProperties;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
-
-/**
- * @version $Rev: 538445 $ $Date: 2007-05-15 23:20:37 -0700 (Tue, 15 May 2007) $
- */
-public class DATAImplementationProcessorTestCase extends TestCase {
-    
-    protected static final QName IMPLEMENTATION_DATA = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.xml");
-
-    private static final String COMPOSITE_USING_DATASOURCE =
-        "<?xml version=\"1.0\" encoding=\"ASCII\"?>" 
-            + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
-            + " <component name=\"DataComponent\">"
-            + "   <tuscany:implementation.data.xml>"
-            + "      <tuscany:connectionInfo datasource=\"dataSource\"/>"
-            + "   </tuscany:implementation.data.xml>"
-            + " </component>"
-            + "</composite>";
-
-    private static final String COMPOSITE_USING_CONNECTION_PROPERTIES =            
-            "<?xml version=\"1.0\" encoding=\"ASCII\"?>" 
-            + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
-            + " <component name=\"DataComponent\">"
-            + "   <tuscany:implementation.data.xml>"
-            + "      <tuscany:connectionInfo>"
-            + "         <tuscany:connectionProperties"
-            + "            driverClass=\"driverClass\""
-            + "            databaseURL=\"databaseURL\""
-            + "            loginTimeout=\"1\"/>"
-            + "      </tuscany:connectionInfo>"
-            + "   </tuscany:implementation.data.xml>"
-            + " </component>"
-            + "</composite>";
-
-    private XMLInputFactory inputFactory;
-    private StAXArtifactProcessor<Object> staxProcessor;
-    private CompositeBuilder compositeBuilder;
-
-    @Override
-    protected void setUp() throws Exception {
-        DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
-        inputFactory = XMLInputFactory.newInstance();
-        StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
-        
-        ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
-        AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
-        SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
-        InterfaceContractMapper mapper = new InterfaceContractMapperImpl();
-        IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
-        compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null);
-    }
-
-    public void testLoadCompositeUsingDatasource() throws Exception {
-        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_DATASOURCE));
-        
-        Composite composite = (Composite)staxProcessor.read(reader);
-        DATAImplementation implementation = (DATAImplementation)composite.getComponents().get(0).getImplementation();
-        assertNotNull(implementation);
-
-        ConnectionInfo connInfo = implementation.getConnectionInfo();
-        assertNotNull(connInfo);
-        assertEquals("dataSource", connInfo.getDataSource());
-        
-        ConnectionProperties connProperties = connInfo.getConnectionProperties();
-        assertNull(connProperties);
-    }
-
-    public void testLoadCompositeUsingConnectionProperties() throws Exception {
-        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_CONNECTION_PROPERTIES));
-
-        Composite composite = (Composite)staxProcessor.read(reader);
-        DATAImplementation implementation = (DATAImplementation)composite.getComponents().get(0).getImplementation();
-        assertNotNull(implementation);
-
-        ConnectionInfo connInfo = implementation.getConnectionInfo();
-        assertNotNull(connInfo);
-        assertNull("dataSource", connInfo.getDataSource());
-        
-        ConnectionProperties connProperties = connInfo.getConnectionProperties();
-        assertNotNull(connProperties);
-        assertEquals("driverClass",connProperties.getDriverClass());
-        assertEquals("databaseURL",connProperties.getDatabaseURL());
-        assertEquals(1,connProperties.getLoginTimeout().intValue());
-    }    
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.implementation.data;
+
+import java.io.StringReader;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.SCABindingFactory;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+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.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.data.engine.config.ConnectionInfo;
+import org.apache.tuscany.sca.data.engine.config.ConnectionProperties;
+import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
+import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
+
+/**
+ * @version $Rev: 538445 $ $Date: 2007-05-15 23:20:37 -0700 (Tue, 15 May 2007) $
+ */
+public class DATAImplementationProcessorTestCase extends TestCase {
+    
+    protected static final QName IMPLEMENTATION_DATA = new QName(Constants.SCA10_TUSCANY_NS, "implementation.data.xml");
+
+    private static final String COMPOSITE_USING_DATASOURCE =
+        "<?xml version=\"1.0\" encoding=\"ASCII\"?>" 
+            + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
+            + " <component name=\"DataComponent\">"
+            + "   <tuscany:implementation.data.xml>"
+            + "      <tuscany:connectionInfo datasource=\"dataSource\"/>"
+            + "   </tuscany:implementation.data.xml>"
+            + " </component>"
+            + "</composite>";
+
+    private static final String COMPOSITE_USING_CONNECTION_PROPERTIES =            
+            "<?xml version=\"1.0\" encoding=\"ASCII\"?>" 
+            + "<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.0\" targetNamespace=\"http://data\" name=\"data\">"
+            + " <component name=\"DataComponent\">"
+            + "   <tuscany:implementation.data.xml>"
+            + "      <tuscany:connectionInfo>"
+            + "         <tuscany:connectionProperties"
+            + "            driverClass=\"driverClass\""
+            + "            databaseURL=\"databaseURL\""
+            + "            loginTimeout=\"1\"/>"
+            + "      </tuscany:connectionInfo>"
+            + "   </tuscany:implementation.data.xml>"
+            + " </component>"
+            + "</composite>";
+
+    private XMLInputFactory inputFactory;
+    private StAXArtifactProcessor<Object> staxProcessor;
+    private CompositeBuilder compositeBuilder;
+
+    @Override
+    protected void setUp() throws Exception {
+        DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+        inputFactory = XMLInputFactory.newInstance();
+        StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
+        
+        ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
+        AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+        SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
+        InterfaceContractMapper mapper = new InterfaceContractMapperImpl();
+        IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
+        compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper, null);
+    }
+
+    public void testLoadCompositeUsingDatasource() throws Exception {
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_DATASOURCE));
+        
+        Composite composite = (Composite)staxProcessor.read(reader);
+        DATAImplementation implementation = (DATAImplementation)composite.getComponents().get(0).getImplementation();
+        assertNotNull(implementation);
+
+        ConnectionInfo connInfo = implementation.getConnectionInfo();
+        assertNotNull(connInfo);
+        assertEquals("dataSource", connInfo.getDataSource());
+        
+        ConnectionProperties connProperties = connInfo.getConnectionProperties();
+        assertNull(connProperties);
+    }
+
+    public void testLoadCompositeUsingConnectionProperties() throws Exception {
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_CONNECTION_PROPERTIES));
+
+        Composite composite = (Composite)staxProcessor.read(reader);
+        DATAImplementation implementation = (DATAImplementation)composite.getComponents().get(0).getImplementation();
+        assertNotNull(implementation);
+
+        ConnectionInfo connInfo = implementation.getConnectionInfo();
+        assertNotNull(connInfo);
+        assertNull("dataSource", connInfo.getDataSource());
+        
+        ConnectionProperties connProperties = connInfo.getConnectionProperties();
+        assertNotNull(connProperties);
+        assertEquals("driverClass",connProperties.getDriverClass());
+        assertEquals("databaseURL",connProperties.getDatabaseURL());
+        assertEquals(1,connProperties.getLoginTimeout().intValue());
+    }    
+}

Modified: incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -37,6 +37,7 @@
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
 import org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
 
 
 /**
@@ -49,10 +50,12 @@
     
     private AssemblyFactory assemblyFactory;
     private EJBImplementationFactory implementationFactory;
+    private Monitor monitor;
     
-    public EJBImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
-        assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
-        implementationFactory = modelFactories.getFactory(EJBImplementationFactory.class);
+    public EJBImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+        this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+        this.implementationFactory = modelFactories.getFactory(EJBImplementationFactory.class);
+        this.monitor = monitor;
     }
 
     public QName getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java Mon May 19 10:49:04 2008
@@ -58,7 +58,7 @@
         DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         inputFactory = XMLInputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
         
         ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);

Modified: incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java Mon May 19 10:49:04 2008
@@ -51,7 +51,7 @@
         inputFactory = XMLInputFactory.newInstance();
         outputFactory = XMLOutputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
     }
 
     public void testReadWriteComposite() throws Exception {

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -40,6 +40,7 @@
 import org.apache.tuscany.sca.assembly.Property;
 import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.assembly.xml.ConfiguredOperationProcessor;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
@@ -57,6 +58,9 @@
 import org.apache.tuscany.sca.implementation.java.introspect.impl.JavaIntrospectionHelper;
 import org.apache.tuscany.sca.interfacedef.Interface;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+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.policy.IntentAttachPointTypeFactory;
 import org.apache.tuscany.sca.policy.PolicyFactory;
 
@@ -73,15 +77,45 @@
     private PolicyAttachPointProcessor policyProcessor;
     private IntentAttachPointTypeFactory  intentAttachPointTypeFactory;
     private ConfiguredOperationProcessor configuredOperationProcessor;
+    private Monitor monitor;
 
-    public JavaImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public JavaImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
         this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
         this.javaFactory = modelFactories.getFactory(JavaImplementationFactory.class);
         this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
         this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
-        this.configuredOperationProcessor = new ConfiguredOperationProcessor(modelFactories);
+        this.monitor = monitor;
+        this.configuredOperationProcessor = new ConfiguredOperationProcessor(modelFactories, this.monitor);
     }
+    
+    /**
+     * Report a error.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+    		 Problem problem = new ProblemImpl(this.getClass().getName(), "impl-javaxml-validation-messages", Severity.ERROR, model, message,(Object[])messageParameters);
+    	     monitor.problem(problem);
+    	 }        
+     }
+     
+     /**
+      * Report a exception.
+      * 
+      * @param problems
+      * @param message
+      * @param model
+      */
+      private void error(String message, Object model, Exception ex) {
+     	 if (monitor != null) {
+     		 Problem problem = new ProblemImpl(this.getClass().getName(), "impl-javaxml-validation-messages", Severity.ERROR, model, message, ex);
+     	     monitor.problem(problem);
+     	 }        
+      }
 
     public JavaImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
 
@@ -147,6 +181,7 @@
         classReference = resolver.resolveModel(ClassReference.class, classReference);
         Class javaClass = classReference.getJavaClass();
         if (javaClass == null) {
+        	error("ClassNotFoundException", resolver, javaImplementation.getName());
             throw new ContributionResolveException(new ClassNotFoundException(javaImplementation.getName()));
         }
         javaImplementation.setJavaClass(javaClass);
@@ -155,7 +190,9 @@
         try {
             javaFactory.createJavaImplementation(javaImplementation, javaImplementation.getJavaClass());
         } catch (IntrospectionException e) {
-            throw new ContributionResolveException(e);
+        	ContributionResolveException ce = new ContributionResolveException(e);
+        	error("ContributionResolveException", javaFactory, ce);
+            throw ce;
         }
 
         mergeComponentType(resolver, javaImplementation);
@@ -180,7 +217,7 @@
                 field = impl.getJavaClass().getDeclaredField(name);
                 int mod = field.getModifiers();
                 if ((Modifier.isPublic(mod) || Modifier.isProtected(mod)) && (!Modifier.isStatic(mod))) {
-                    return new JavaElementImpl(field);
+                	return new JavaElementImpl(field);
                 }
             } catch (NoSuchFieldException e1) {
                 // Ignore

Added: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,23 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+ClassNotFoundException = Class Not Found Exception: {0}
+ContributionResolveException = Contribution Resolve Exception occured due to: 
+

Propchange: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/resources/impl-javaxml-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java Mon May 19 10:49:04 2008
@@ -68,7 +68,7 @@
         DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         inputFactory = XMLInputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
 
         ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java Mon May 19 10:49:04 2008
@@ -50,7 +50,7 @@
         inputFactory = XMLInputFactory.newInstance();
         outputFactory = XMLOutputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
     }
 
     public void testReadWriteComposite() throws Exception {

Modified: incubator/tuscany/java/sca/modules/implementation-node-xml/src/main/java/org/apache/tuscany/sca/implementation/node/xml/ConfiguredNodeImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node-xml/src/main/java/org/apache/tuscany/sca/implementation/node/xml/ConfiguredNodeImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node-xml/src/main/java/org/apache/tuscany/sca/implementation/node/xml/ConfiguredNodeImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-node-xml/src/main/java/org/apache/tuscany/sca/implementation/node/xml/ConfiguredNodeImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -42,6 +42,7 @@
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation;
 import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
 
 
 /**
@@ -62,10 +63,10 @@
     private AssemblyFactory assemblyFactory;
     private NodeImplementationFactory implementationFactory;
     
-    public ConfiguredNodeImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
-        contributionFactory = modelFactories.getFactory(ContributionFactory.class);
-        assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
-        implementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
+    public ConfiguredNodeImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+        this.contributionFactory = modelFactories.getFactory(ContributionFactory.class);
+        this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+        this.implementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
     }
 
     public QName getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/implementation-node-xml/src/main/java/org/apache/tuscany/sca/implementation/node/xml/NodeImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node-xml/src/main/java/org/apache/tuscany/sca/implementation/node/xml/NodeImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node-xml/src/main/java/org/apache/tuscany/sca/implementation/node/xml/NodeImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-node-xml/src/main/java/org/apache/tuscany/sca/implementation/node/xml/NodeImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -37,6 +37,7 @@
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.implementation.node.NodeImplementation;
 import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
 
 
 /**
@@ -50,9 +51,9 @@
     private AssemblyFactory assemblyFactory;
     private NodeImplementationFactory implementationFactory;
     
-    public NodeImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
-        assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
-        implementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
+    public NodeImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+        this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+        this.implementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
     }
 
     public QName getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/implementation-node-xml/src/test/java/org/apache/tuscany/sca/implementation/node/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node-xml/src/test/java/org/apache/tuscany/sca/implementation/node/xml/ReadTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node-xml/src/test/java/org/apache/tuscany/sca/implementation/node/xml/ReadTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-node-xml/src/test/java/org/apache/tuscany/sca/implementation/node/xml/ReadTestCase.java Mon May 19 10:49:04 2008
@@ -57,7 +57,7 @@
         DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         inputFactory = XMLInputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
         
         ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);

Modified: incubator/tuscany/java/sca/modules/implementation-node-xml/src/test/java/org/apache/tuscany/sca/implementation/node/xml/WriteTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node-xml/src/test/java/org/apache/tuscany/sca/implementation/node/xml/WriteTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node-xml/src/test/java/org/apache/tuscany/sca/implementation/node/xml/WriteTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-node-xml/src/test/java/org/apache/tuscany/sca/implementation/node/xml/WriteTestCase.java Mon May 19 10:49:04 2008
@@ -51,7 +51,7 @@
         inputFactory = XMLInputFactory.newInstance();
         outputFactory = XMLOutputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
     }
 
     public void testReadWriteComposite() throws Exception {

Modified: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -42,6 +42,7 @@
 import org.apache.tuscany.sca.assembly.Property;
 import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.osgi.BundleReference;
@@ -57,6 +58,9 @@
 import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 import org.osgi.framework.Bundle;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -86,20 +90,48 @@
     private JavaInterfaceFactory javaInterfaceFactory;
     private AssemblyFactory assemblyFactory;
     private ModelFactoryExtensionPoint modelFactories;
-    
+    private Monitor monitor;
     
     private static final DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
     static {
         domFactory.setNamespaceAware(true);
     }
 
-    public OSGiImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
-        
+    public OSGiImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+    	this.monitor = monitor;
         this.modelFactories = modelFactories;
         this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
         this.javaInterfaceFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
     }
     
+    /**
+     * Report a exception.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Exception ex) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "impl-osgi-validation-messages", Severity.ERROR, model, message, ex);
+	        monitor.problem(problem);
+    	 }
+    }
+    
+    /**
+     * Report a error.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "impl-osgi-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
+    }
+    
     public QName getArtifactType() {
         return IMPLEMENTATION_OSGI;
     }
@@ -171,8 +203,10 @@
                     refCallbackProperties.put(refCallbackName, props);
                 else if (serviceCallbackName != null)
                     serviceCallbackProperties.put(serviceCallbackName, props);
-                else
-                    throw new ContributionReadException("Properties in implementation.osgi should specify service or reference");                
+                else {
+                	error("PropertyShouldSpecifySR", reader);
+                    throw new ContributionReadException("Properties in implementation.osgi should specify service or reference");
+                }
             }
 
         }
@@ -208,9 +242,11 @@
             Bundle bundle = (Bundle)resolvedBundle.getBundle();
             if (bundle != null)
                 impl.setOSGiBundle(bundle);
-            else
+            else {
+            	error("CouldNotLocateOSGiBundle", impl, impl.getBundleSymbolicName());
                 throw new ContributionResolveException("Could not locate OSGi bundle " + 
                         impl.getBundleSymbolicName());
+            }
             
             String bundleName = resolvedBundle.getBundleRelativePath();
             String ctURI = bundleName.endsWith(".jar") || bundleName.endsWith(".JAR")? 
@@ -223,7 +259,7 @@
             componentType.setUnresolved(true);
             componentType = resolver.resolveModel(ComponentType.class, componentType);
             if (componentType.isUnresolved()) {
-
+            	error("MissingComponentTypeFile", impl, ctURI);
                 throw new ContributionResolveException("missing .componentType side file " + ctURI);
             }
             
@@ -478,7 +514,9 @@
             Document value = readPropertyValue(reader, prop.getXSDType());
             prop.setValue(value);
         } catch (ParserConfigurationException e) {
-            throw new ContributionReadException(e);
+        	ContributionReadException ce = new ContributionReadException(e);
+        	error("ContributionReadException", reader, ce);
+            throw ce;
         }
     }
     

Added: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,24 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+ContributionReadException = ContributionReadException occured due to:
+PropertyShouldSpecifySR = Properties in implementation.osgi should specify service or reference
+CouldNotLocateOSGiBundle = Could not locate OSGi bundle: {0}
+MissingComponentTypeFile = Missing .componentType side file: {0}
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/resources/impl-osgi-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java Mon May 19 10:49:04 2008
@@ -63,7 +63,7 @@
         DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         inputFactory = XMLInputFactory.newInstance();
         StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
         
         ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);

Modified: incubator/tuscany/java/sca/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -28,6 +28,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.contribution.Artifact;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
@@ -39,6 +40,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.implementation.resource.ResourceImplementation;
 import org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 
 /**
@@ -51,10 +55,26 @@
     
     private ContributionFactory contributionFactory;
     private ResourceImplementationFactory implementationFactory;
+    private Monitor monitor;
     
-    public ResourceImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public ResourceImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         contributionFactory = modelFactories.getFactory(ContributionFactory.class);
         implementationFactory = modelFactories.getFactory(ResourceImplementationFactory.class);
+        this.monitor = monitor;
+    }
+    
+    /**
+     * Report a exception.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Exception ex) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "impl-resource-validation-messages", Severity.ERROR, model, message, ex);
+	        monitor.problem(problem);
+    	 }
     }
 
     public QName getArtifactType() {
@@ -101,7 +121,9 @@
                 implementation.setLocationURL(new URL(resolved.getLocation()));
                 implementation.setUnresolved(false);
             } catch (IOException e) {
-                throw new ContributionResolveException(e);
+            	ContributionResolveException ce = new ContributionResolveException(e);
+            	error("ContributionResolveException", resolver, ce);
+                throw ce;
             }
         }
     }

Added: incubator/tuscany/java/sca/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,21 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+ContributionResolveException = ContributionResolveException occured due to:
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/implementation-resource/src/main/resources/impl-resource-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -28,6 +28,7 @@
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
@@ -38,6 +39,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.implementation.spring.xml.SpringXMLComponentTypeLoader;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+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.policy.PolicyFactory;
 
 /**
@@ -57,12 +61,42 @@
     private JavaInterfaceFactory javaFactory;
     private PolicyFactory policyFactory;
     private PolicyAttachPointProcessor policyProcessor;
+    private Monitor monitor;
     
-    public SpringImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public SpringImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
         this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
         this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
         this.policyProcessor = new PolicyAttachPointProcessor(policyFactory);
+        this.monitor = monitor;
+    }
+    
+    /**
+     * Report a exception.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Exception ex) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, ex);
+	        monitor.problem(problem);
+    	 }
+    }
+    
+    /**
+     * Report a error.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
     }
 
     /*
@@ -92,6 +126,7 @@
         // Read the location attribute for the spring implementation
         String springLocation = reader.getAttributeValue(null, LOCATION);
         if (springLocation == null) {
+        	error("LocationAttributeMissing", reader);
             throw new ContributionReadException(MSG_LOCATION_MISSING);
         }
         springImplementation.setLocation(springLocation);
@@ -155,7 +190,9 @@
             // Load the Spring Implementation information from its application context file...
             springLoader.load(springImplementation);
         } catch (ContributionReadException e) {
-            throw new ContributionResolveException(e);
+        	ContributionResolveException ce = new ContributionResolveException(e);
+        	error("ContributionResolveException", resolver, ce);
+            throw ce;
         }
 
         ComponentType ct = springImplementation.getComponentType();
@@ -163,8 +200,8 @@
             // If the introspection fails to resolve, try to find a side file...
             ComponentType componentType = resolver.resolveModel(ComponentType.class, ct);
             if (componentType.isUnresolved()) {
-                throw new ContributionResolveException(
-                                                       "SpringArtifactProcessor: unable to resolve componentType for Spring component");
+            	error("UnableToResolveComponentType", resolver);
+                throw new ContributionResolveException("SpringArtifactProcessor: unable to resolve componentType for Spring component");
             }
             springImplementation.setComponentType(componentType);
 

Added: incubator/tuscany/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,23 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+LocationAttributeMissing = Reading implementation.spring - location attribute missing
+ContributionResolveException = ContributionResolveException occured due to:
+UnableToResolveComponentType = SpringArtifactProcessor: unable to resolve componentType for Spring component
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -29,6 +29,7 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.contribution.Artifact;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
@@ -38,6 +39,9 @@
 import org.apache.tuscany.sca.contribution.service.ContributionReadException;
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 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;
 
 
 /**
@@ -51,11 +55,27 @@
     private AssemblyFactory assemblyFactory;
     private ContributionFactory contributionFactory;
     private WidgetImplementationFactory implementationFactory;
+    private Monitor monitor;
     
-    public WidgetImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public WidgetImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
     	assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
         contributionFactory = modelFactories.getFactory(ContributionFactory.class);
         implementationFactory = new WidgetImplementationFactory(modelFactories); 
+        this.monitor = monitor;
+    }
+    
+    /**
+     * Report a exception.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Exception ex) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "impl-widget-validation-messages", Severity.ERROR, model, message, ex);
+	        monitor.problem(problem);
+    	 }
     }
 
     public QName getArtifactType() {
@@ -106,7 +126,9 @@
                 widgetIntrospector.introspectImplementation();
 
             } catch (IOException e) {
-                throw new ContributionResolveException(e);
+            	ContributionResolveException ce = new ContributionResolveException(e);
+            	error("ContributionResolveException", resolver, ce);
+                throw ce;
             }
         }
     }

Added: incubator/tuscany/java/sca/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,21 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+ContributionResolveException = ContributionResolveException occured due to:
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/implementation-widget/src/main/resources/impl-widget-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -26,6 +26,7 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.contribution.Artifact;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
@@ -38,6 +39,9 @@
 import org.apache.tuscany.sca.implementation.xquery.XQueryImplementation;
 import org.apache.tuscany.sca.implementation.xquery.XQueryImplementationFactory;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Processor for the XQuery implementation type artifact
@@ -54,11 +58,27 @@
     private AssemblyFactory assemblyFactory;
     private JavaInterfaceFactory javaFactory;
     private ContributionFactory contributionFactory;
+    private Monitor monitor;
 
-    public XQueryImplementationProcessor(ModelFactoryExtensionPoint modelFactoryExtensionPoint) {
+    public XQueryImplementationProcessor(ModelFactoryExtensionPoint modelFactoryExtensionPoint, Monitor monitor) {
         assemblyFactory = modelFactoryExtensionPoint.getFactory(AssemblyFactory.class);
         javaFactory = modelFactoryExtensionPoint.getFactory(JavaInterfaceFactory.class);
         contributionFactory = modelFactoryExtensionPoint.getFactory(ContributionFactory.class);
+        this.monitor = monitor;
+    }
+    
+    /**
+     * Report a error.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+    private void error(String message, Object model, Object... messageParameters) {
+    	 if (monitor != null) {
+	        Problem problem = new ProblemImpl(this.getClass().getName(), "impl-xquery-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
     }
 
     public QName getArtifactType() {
@@ -74,6 +94,7 @@
         /* Read the location attribute for the XQuery implementation  */
         String xqueryLocation = reader.getAttributeValue(null, LOCATION);
         if (xqueryLocation == null) {
+        	error("LocationAttributeMissing", reader);
             throw new ContributionReadException(MSG_LOCATION_MISSING);
         }
         /* Create the XQuery implementation and set the location into it */
@@ -119,6 +140,7 @@
         artifact.setURI(xqueryImplementation.getLocation());
     	artifact = resolver.resolveModel(Artifact.class, artifact);
     	if (artifact.getLocation() == null) {
+    		error("CouldNotLocateFile", resolver, xqueryImplementation.getLocation());
             throw new ContributionResolveException("Could not locate file: " + xqueryImplementation.getLocation());
         }
     	xqueryImplementation.setLocationURL(artifact.getLocation());

Added: incubator/tuscany/java/sca/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,22 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+CouldNotLocateFile = Could not locate file: {0}
+LocationAttributeMissing = Reading implementation.xquery - location attribute missing
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/implementation-xquery/src/main/resources/impl-xquery-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/tuscany/java/sca/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java Mon May 19 10:49:04 2008
@@ -38,6 +38,9 @@
 import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  *
@@ -46,9 +49,11 @@
 public class JavaInterfaceProcessor implements StAXArtifactProcessor<JavaInterfaceContract>, JavaConstants {
 
     private JavaInterfaceFactory javaFactory;
+    private Monitor monitor;
 
-    public JavaInterfaceProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public JavaInterfaceProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
+        this.monitor = monitor;
     }
     
     private JavaInterface createJavaInterface(String interfaceName) {

Added: incubator/tuscany/java/sca/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,44 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+ClassNotFoundException = Class Not Found Exception: {0}
+ContributionResolveException = ContributionResolveException occured due to :
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+ClassNotFoundException = Class Not Found Exception: {0}
+ContributionResolveException = ContributionResolveException occured due to :
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/modules/interface-java-xml/src/main/resources/interface-javaxml-validation-messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message