tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r657881 [4/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/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsDocumentProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsDocumentProcessor.java Mon May 19 10:49:04 2008
@@ -1,154 +1,197 @@
-/*
- * 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.definitions.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-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.definitions.SCADefinitions;
-import org.apache.tuscany.sca.definitions.impl.SCADefinitionsImpl;
-import org.apache.tuscany.sca.definitions.util.SCADefinitionsUtil;
-
-/**
- * A SCA Definitions Document processor.
- *
- * @version $Rev$ $Date$
- */
-public class SCADefinitionsDocumentProcessor  implements URLArtifactProcessor<SCADefinitions> {
-    private StAXArtifactProcessor<Object> extensionProcessor;
-    private XMLInputFactory inputFactory;
-    private static final String TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-    private static final String DEFINITIONS = "definitions";
-    private static final QName DEFINITIONS_QNAME = new QName(TUSCANY_NS, DEFINITIONS);
-
-    /**
-     * Construct a new SCADefinitions processor
-     * @param assemblyFactory
-     * @param policyFactory
-     * @param staxProcessor
-     */
-    public SCADefinitionsDocumentProcessor(StAXArtifactProcessor<Object> staxProcessor,
-                                           XMLInputFactory inputFactory) {
-        this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
-        this.inputFactory = inputFactory;
-    }
-
-    /**
-     * Constructs a new SCADefinitions processor.
-     * 
-     * @param modelFactories
-     * @param staxProcessor
-     */
-    public SCADefinitionsDocumentProcessor(ModelFactoryExtensionPoint modelFactories, StAXArtifactProcessor<Object> staxProcessor) {
-        this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
-        this.inputFactory = modelFactories.getFactory(XMLInputFactory.class);
-    }
-    
-
-    public SCADefinitions read(URL contributionURL, final URI uri, final URL url) throws ContributionReadException {
-        InputStream urlStream = null; 
-        try {        	
-            // Allow privileged access to open URL stream. Add FilePermission to added to security
-            // policy file.
-            try {
-                urlStream = AccessController.doPrivileged(new PrivilegedExceptionAction<InputStream>() {
-                    public InputStream run() throws IOException {
-                        URLConnection connection = url.openConnection();
-                        connection.setUseCaches(false);
-                        return connection.getInputStream();
-                    }
-                });
-            } catch (PrivilegedActionException e) {
-                throw (IOException)e.getException();
-            }
-            
-            //urlStream = createInputStream(url);
-            XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
-            
-            SCADefinitions definitions = new SCADefinitionsImpl();
-            QName name = null;
-            int event;
-            while ( reader.hasNext() ) {
-                event = reader.next();
-                
-                if ( event == XMLStreamConstants.START_ELEMENT  ||
-                    event == XMLStreamConstants.END_ELEMENT ) {
-                    name = reader.getName();
-                    if ( name.equals(DEFINITIONS_QNAME) ) {
-                        if ( event == XMLStreamConstants.END_ELEMENT ) {
-                            return definitions;
-                        } 
-                    } else {
-                        SCADefinitions aDefn = (SCADefinitions)extensionProcessor.read(reader);
-                        SCADefinitionsUtil.aggregateSCADefinitions(aDefn, definitions);
-                    }
-                }
-            }
-            
-            return definitions;
-        } catch (XMLStreamException e) {
-            throw new ContributionReadException(e);
-        } catch (IOException e) {
-            throw new ContributionReadException(e);
-        } finally {
-        
-            try {
-                if (urlStream != null) {
-                    urlStream.close();
-                    urlStream = null;
-                }
-            } catch (IOException ioe) {
-                //ignore
-            }
-        }
-    }
-    
-    public void resolve(SCADefinitions scaDefinitions, ModelResolver resolver) throws ContributionResolveException {
-        SCADefinitionsUtil.stripDuplicates(scaDefinitions);
-        extensionProcessor.resolve(scaDefinitions, resolver);
-    }
-    
-    public String getArtifactType() {
-        return "definitions.xml";
-    }
-    
-    public Class<SCADefinitions> getModelType() {
-        return SCADefinitions.class;
-    }
-
-}
+/*
+ * 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.definitions.xml;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
+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.definitions.SCADefinitions;
+import org.apache.tuscany.sca.definitions.impl.SCADefinitionsImpl;
+import org.apache.tuscany.sca.definitions.util.SCADefinitionsUtil;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+
+/**
+ * A SCA Definitions Document processor.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCADefinitionsDocumentProcessor  implements URLArtifactProcessor<SCADefinitions> {
+    private StAXArtifactProcessor<Object> extensionProcessor;
+    private XMLInputFactory inputFactory;
+    private static final String TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
+    private static final String DEFINITIONS = "definitions";
+    private static final QName DEFINITIONS_QNAME = new QName(TUSCANY_NS, DEFINITIONS);
+    private Monitor monitor;
+
+    /**
+     * Construct a new SCADefinitions processor
+     * @param assemblyFactory
+     * @param policyFactory
+     * @param staxProcessor
+     */
+    public SCADefinitionsDocumentProcessor(StAXArtifactProcessor<Object> staxProcessor,
+                                           XMLInputFactory inputFactory,
+                                           Monitor monitor) {
+        this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
+        this.inputFactory = inputFactory;
+        this.monitor = monitor;
+    }
+
+    /**
+     * Constructs a new SCADefinitions processor.
+     * 
+     * @param modelFactories
+     * @param staxProcessor
+     */
+    public SCADefinitionsDocumentProcessor(ModelFactoryExtensionPoint modelFactories, 
+    									   StAXArtifactProcessor<Object> staxProcessor,
+    									   Monitor monitor) {
+        this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
+        this.inputFactory = modelFactories.getFactory(XMLInputFactory.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(), "definitions-xml-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(), "definitions-xml-validation-messages", Severity.ERROR, model, message, ex);
+    	     monitor.problem(problem);
+    	 }        
+     }
+    
+
+    public SCADefinitions read(URL contributionURL, final URI uri, final URL url) throws ContributionReadException {
+        InputStream urlStream = null; 
+        try {        	
+            // Allow privileged access to open URL stream. Add FilePermission to added to security
+            // policy file.
+            try {
+                urlStream = AccessController.doPrivileged(new PrivilegedExceptionAction<InputStream>() {
+                    public InputStream run() throws IOException {
+                        URLConnection connection = url.openConnection();
+                        connection.setUseCaches(false);
+                        return connection.getInputStream();
+                    }
+                });
+            } catch (PrivilegedActionException e) {
+            	error("PrivilegedActionException", url, (IOException)e.getException());
+                throw (IOException)e.getException();
+            }
+            
+            //urlStream = createInputStream(url);
+            XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
+            
+            SCADefinitions definitions = new SCADefinitionsImpl();
+            QName name = null;
+            int event;
+            while ( reader.hasNext() ) {
+                event = reader.next();
+                
+                if ( event == XMLStreamConstants.START_ELEMENT  ||
+                    event == XMLStreamConstants.END_ELEMENT ) {
+                    name = reader.getName();
+                    if ( name.equals(DEFINITIONS_QNAME) ) {
+                        if ( event == XMLStreamConstants.END_ELEMENT ) {
+                            return definitions;
+                        } 
+                    } else {
+                        SCADefinitions aDefn = (SCADefinitions)extensionProcessor.read(reader);
+                        SCADefinitionsUtil.aggregateSCADefinitions(aDefn, definitions);
+                    }
+                }
+            }
+            
+            return definitions;
+        } catch (XMLStreamException e) {
+        	ContributionReadException ce = new ContributionReadException(e);
+        	error("ContributionReadException", inputFactory, ce);
+            throw ce;
+        } catch (IOException e) {
+        	ContributionReadException ce = new ContributionReadException(e);
+        	error("ContributionReadException", inputFactory, ce);
+            throw ce;
+        } finally {
+        
+            try {
+                if (urlStream != null) {
+                    urlStream.close();
+                    urlStream = null;
+                }
+            } catch (IOException ioe) {
+                //ignore
+            }
+        }
+    }
+    
+    public void resolve(SCADefinitions scaDefinitions, ModelResolver resolver) throws ContributionResolveException {
+        SCADefinitionsUtil.stripDuplicates(scaDefinitions);
+        extensionProcessor.resolve(scaDefinitions, resolver);
+    }
+    
+    public String getArtifactType() {
+        return "definitions.xml";
+    }
+    
+    public Class<SCADefinitions> getModelType() {
+        return SCADefinitions.class;
+    }
+
+}

Modified: incubator/tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java Mon May 19 10:49:04 2008
@@ -1,219 +1,225 @@
-/*
- * 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.definitions.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-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.contribution.processor.BaseStAXArtifactProcessor;
-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.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.definitions.SCADefinitions;
-import org.apache.tuscany.sca.definitions.impl.SCADefinitionsImpl;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
-
-/**
- * Processor for SCA Definitions
- *
- * @version $Rev$ $Date$
- */
-public class SCADefinitionsProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<SCADefinitions> {
-    
-    private StAXArtifactProcessor<Object> extensionProcessor;
-    
-    public static final String BINDING = "binding";
-    public static final String IMPLEMENTATION = "implementation";
-    public static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
-    public static final String SCA_DEFINITIONS = "definitions";
-    public static final QName SCA_DEFINITIONS_QNAME = new QName(SCA10_NS, SCA_DEFINITIONS);
-    public static final String TARGET_NAMESPACE = "targetNamespace";
-    public static final String NAME = "name";
-    
-    /**
-     * Construct a new definitions processor
-     * @param extensionProcessor 
-     * @param modelResolver 
-     */
-    public SCADefinitionsProcessor(StAXArtifactProcessor<Object> extensionProcessor,
-                              ModelResolver modelResolver) {
-        this.extensionProcessor = extensionProcessor;
-    }
-    
-    public SCADefinitionsProcessor(ExtensionPointRegistry extensionPoints, StAXArtifactProcessor<Object> extensionProcessor) {
-        this.extensionProcessor = extensionProcessor;
-    }
-
-    public SCADefinitions read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-        QName name = null;
-        SCADefinitions definitions = null;
-        String targetNamespace = null;
-
-        while (reader.hasNext()) {
-            int event = reader.getEventType();
-            switch (event) {
-                case START_ELEMENT: {
-                    name = reader.getName();
-                    if ( SCA_DEFINITIONS_QNAME.equals(name)) {
-                        definitions = new SCADefinitionsImpl();
-                        targetNamespace = reader.getAttributeValue(null, TARGET_NAMESPACE);
-                        definitions.setTargetNamespace(targetNamespace);
-                    } else {
-                        Object extension = extensionProcessor.read(reader);
-                        if (extension != null) {
-                            if ( extension instanceof Intent ) {
-                                Intent intent = (Intent)extension;
-                                intent.setName(new QName(targetNamespace, 
-                                                                      intent.getName().getLocalPart()));
-                                if ( intent instanceof QualifiedIntent ) {
-                                    QualifiedIntent qualifiedIntent = (QualifiedIntent)intent;
-                                    qualifiedIntent.getQualifiableIntent().
-                                            setName(new QName(targetNamespace,
-                                                              qualifiedIntent.getQualifiableIntent().getName().getLocalPart()));
-                                }
-                                
-                                definitions.getPolicyIntents().add(intent);
-                            } else if ( extension instanceof PolicySet ) {
-                                PolicySet policySet = (PolicySet)extension;
-                                policySet.setName(new QName(targetNamespace, 
-                                                            policySet.getName().getLocalPart()));
-                                definitions.getPolicySets().add(policySet);
-                            } else if ( extension instanceof IntentAttachPointType ) {
-                                IntentAttachPointType type = (IntentAttachPointType)extension;
-                                if ( type.getName().getLocalPart().startsWith(BINDING)) {
-                                    definitions.getBindingTypes().add((IntentAttachPointType)extension);
-                                } else if ( type.getName().getLocalPart().startsWith(IMPLEMENTATION)) {
-                                    definitions.getImplementationTypes().add((IntentAttachPointType)extension);
-                                }
-                            } 
-                        }
-                        break;
-                    }
-                }
-
-                case XMLStreamConstants.CHARACTERS:
-                    break;
-
-                case END_ELEMENT:
-                    name = reader.getName();
-                    if ( SCA_DEFINITIONS_QNAME.equals(name)) {
-                        return definitions;
-                    }
-                    break;
-            }
-            
-            //Read the next element
-            if (reader.hasNext()) {
-                reader.next();
-            }
-        }
-        return definitions;
-    }
-    
-    public void write(SCADefinitions definitions, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
-        writeStartDocument(writer, SCA10_NS, SCA_DEFINITIONS, 
-                               new XAttr(TARGET_NAMESPACE, definitions.getTargetNamespace().toString()));
-    
-        for (Intent policyIntent : definitions.getPolicyIntents()) {
-            extensionProcessor.write(policyIntent, writer);
-        }
-        
-        for (PolicySet policySet : definitions.getPolicySets()) {
-            extensionProcessor.write(policySet, writer);
-        }
-        
-        for (IntentAttachPointType bindingType : definitions.getBindingTypes()) {
-            extensionProcessor.write(bindingType, writer);
-        }
-        
-        for (IntentAttachPointType implType : definitions.getImplementationTypes()) {
-            extensionProcessor.write(implType, writer);
-        }
-
-        writeEndDocument(writer);
-    }
-    
-    public void resolve(SCADefinitions scaDefns, ModelResolver resolver) throws ContributionResolveException {
-        // start by adding all of the top level artifacts into the resolver as there
-        // are many cross artifact references in a definitions file and we don't want
-        // to be dependent on the order things appear
-        
-        for (Intent policyIntent : scaDefns.getPolicyIntents()) {
-            resolver.addModel(policyIntent);
-        }
-        
-        for (PolicySet policySet : scaDefns.getPolicySets()) {
-            resolver.addModel(policySet);
-        }
-        
-        for (IntentAttachPointType bindingType : scaDefns.getBindingTypes()) {
-            resolver.addModel(bindingType);
-        }
-        
-        for (IntentAttachPointType implType : scaDefns.getImplementationTypes()) {
-            resolver.addModel(implType);
-        }
-        
-        // now resolve everything to ensure that any references between
-        // artifacts are satisfied
-        
-        for (int count = 0, size = scaDefns.getPolicyIntents().size(); count < size; count++) {
-            Intent intent = scaDefns.getPolicyIntents().get(count);
-            extensionProcessor.resolve(intent, resolver);
-        }
-        
-        for (int count = 0, size = scaDefns.getPolicySets().size(); count < size; count++) {
-            PolicySet policySet = scaDefns.getPolicySets().get(count);
-            extensionProcessor.resolve(policySet, resolver);
-        }
-        
-        for (int count = 0, size = scaDefns.getBindingTypes().size(); count < size; count++) {
-            IntentAttachPointType bindingType = scaDefns.getBindingTypes().get(count);
-            extensionProcessor.resolve(bindingType, resolver);
-        }
-        
-        for (int count = 0, size = scaDefns.getImplementationTypes().size(); count < size; count++) {
-            IntentAttachPointType implType = scaDefns.getImplementationTypes().get(count);
-            extensionProcessor.resolve(implType, resolver);
-        }
-    }
-    
-    public QName getArtifactType() {
-        return SCA_DEFINITIONS_QNAME;
-    }
-    
-    public Class<SCADefinitions> getModelType() {
-        return SCADefinitions.class;
-    }
-
-}
+/*
+ * 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.definitions.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+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.contribution.processor.BaseStAXArtifactProcessor;
+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.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.definitions.SCADefinitions;
+import org.apache.tuscany.sca.definitions.impl.SCADefinitionsImpl;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.IntentAttachPointType;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.QualifiedIntent;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ * Processor for SCA Definitions
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCADefinitionsProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<SCADefinitions> {
+    
+    private StAXArtifactProcessor<Object> extensionProcessor;
+    private Monitor monitor;
+    
+    public static final String BINDING = "binding";
+    public static final String IMPLEMENTATION = "implementation";
+    public static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
+    public static final String SCA_DEFINITIONS = "definitions";
+    public static final QName SCA_DEFINITIONS_QNAME = new QName(SCA10_NS, SCA_DEFINITIONS);
+    public static final String TARGET_NAMESPACE = "targetNamespace";
+    public static final String NAME = "name";
+    
+    /**
+     * Construct a new definitions processor
+     * @param extensionProcessor 
+     * @param modelResolver 
+     */
+    public SCADefinitionsProcessor(StAXArtifactProcessor<Object> extensionProcessor,
+                              ModelResolver modelResolver, Monitor monitor) {
+        this.extensionProcessor = extensionProcessor;
+        this.monitor = monitor;
+    }
+    
+    public SCADefinitionsProcessor(ExtensionPointRegistry extensionPoints, 
+    		                       StAXArtifactProcessor<Object> extensionProcessor,
+    		                       Monitor monitor) {
+        this.extensionProcessor = extensionProcessor;
+        this.monitor = monitor;
+    }
+
+    public SCADefinitions read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+        QName name = null;
+        SCADefinitions definitions = null;
+        String targetNamespace = null;
+
+        while (reader.hasNext()) {
+            int event = reader.getEventType();
+            switch (event) {
+                case START_ELEMENT: {
+                    name = reader.getName();
+                    if ( SCA_DEFINITIONS_QNAME.equals(name)) {
+                        definitions = new SCADefinitionsImpl();
+                        targetNamespace = reader.getAttributeValue(null, TARGET_NAMESPACE);
+                        definitions.setTargetNamespace(targetNamespace);
+                    } else {
+                        Object extension = extensionProcessor.read(reader);
+                        if (extension != null) {
+                            if ( extension instanceof Intent ) {
+                                Intent intent = (Intent)extension;
+                                intent.setName(new QName(targetNamespace, 
+                                                                      intent.getName().getLocalPart()));
+                                if ( intent instanceof QualifiedIntent ) {
+                                    QualifiedIntent qualifiedIntent = (QualifiedIntent)intent;
+                                    qualifiedIntent.getQualifiableIntent().
+                                            setName(new QName(targetNamespace,
+                                                              qualifiedIntent.getQualifiableIntent().getName().getLocalPart()));
+                                }
+                                
+                                definitions.getPolicyIntents().add(intent);
+                            } else if ( extension instanceof PolicySet ) {
+                                PolicySet policySet = (PolicySet)extension;
+                                policySet.setName(new QName(targetNamespace, 
+                                                            policySet.getName().getLocalPart()));
+                                definitions.getPolicySets().add(policySet);
+                            } else if ( extension instanceof IntentAttachPointType ) {
+                                IntentAttachPointType type = (IntentAttachPointType)extension;
+                                if ( type.getName().getLocalPart().startsWith(BINDING)) {
+                                    definitions.getBindingTypes().add((IntentAttachPointType)extension);
+                                } else if ( type.getName().getLocalPart().startsWith(IMPLEMENTATION)) {
+                                    definitions.getImplementationTypes().add((IntentAttachPointType)extension);
+                                }
+                            } 
+                        }
+                        break;
+                    }
+                }
+
+                case XMLStreamConstants.CHARACTERS:
+                    break;
+
+                case END_ELEMENT:
+                    name = reader.getName();
+                    if ( SCA_DEFINITIONS_QNAME.equals(name)) {
+                        return definitions;
+                    }
+                    break;
+            }
+            
+            //Read the next element
+            if (reader.hasNext()) {
+                reader.next();
+            }
+        }
+        return definitions;
+    }
+    
+    public void write(SCADefinitions definitions, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+
+        writeStartDocument(writer, SCA10_NS, SCA_DEFINITIONS, 
+                               new XAttr(TARGET_NAMESPACE, definitions.getTargetNamespace().toString()));
+    
+        for (Intent policyIntent : definitions.getPolicyIntents()) {
+            extensionProcessor.write(policyIntent, writer);
+        }
+        
+        for (PolicySet policySet : definitions.getPolicySets()) {
+            extensionProcessor.write(policySet, writer);
+        }
+        
+        for (IntentAttachPointType bindingType : definitions.getBindingTypes()) {
+            extensionProcessor.write(bindingType, writer);
+        }
+        
+        for (IntentAttachPointType implType : definitions.getImplementationTypes()) {
+            extensionProcessor.write(implType, writer);
+        }
+
+        writeEndDocument(writer);
+    }
+    
+    public void resolve(SCADefinitions scaDefns, ModelResolver resolver) throws ContributionResolveException {
+        // start by adding all of the top level artifacts into the resolver as there
+        // are many cross artifact references in a definitions file and we don't want
+        // to be dependent on the order things appear
+        
+        for (Intent policyIntent : scaDefns.getPolicyIntents()) {
+            resolver.addModel(policyIntent);
+        }
+        
+        for (PolicySet policySet : scaDefns.getPolicySets()) {
+            resolver.addModel(policySet);
+        }
+        
+        for (IntentAttachPointType bindingType : scaDefns.getBindingTypes()) {
+            resolver.addModel(bindingType);
+        }
+        
+        for (IntentAttachPointType implType : scaDefns.getImplementationTypes()) {
+            resolver.addModel(implType);
+        }
+        
+        // now resolve everything to ensure that any references between
+        // artifacts are satisfied
+        
+        for (int count = 0, size = scaDefns.getPolicyIntents().size(); count < size; count++) {
+            Intent intent = scaDefns.getPolicyIntents().get(count);
+            extensionProcessor.resolve(intent, resolver);
+        }
+        
+        for (int count = 0, size = scaDefns.getPolicySets().size(); count < size; count++) {
+            PolicySet policySet = scaDefns.getPolicySets().get(count);
+            extensionProcessor.resolve(policySet, resolver);
+        }
+        
+        for (int count = 0, size = scaDefns.getBindingTypes().size(); count < size; count++) {
+            IntentAttachPointType bindingType = scaDefns.getBindingTypes().get(count);
+            extensionProcessor.resolve(bindingType, resolver);
+        }
+        
+        for (int count = 0, size = scaDefns.getImplementationTypes().size(); count < size; count++) {
+            IntentAttachPointType implType = scaDefns.getImplementationTypes().get(count);
+            extensionProcessor.resolve(implType, resolver);
+        }
+    }
+    
+    public QName getArtifactType() {
+        return SCA_DEFINITIONS_QNAME;
+    }
+    
+    public Class<SCADefinitions> getModelType() {
+        return SCADefinitions.class;
+    }
+
+}

Added: incubator/tuscany/java/sca/modules/definitions-xml/src/main/resources/definitions-xml-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/definitions-xml/src/main/resources/definitions-xml-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/definitions-xml/src/main/resources/definitions-xml-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/definitions-xml/src/main/resources/definitions-xml-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.
+#
+#
+ContributionReadException = ContributionReadException occured due to :
+PrivilegedActionException = Privileged Action Exception occured due to FilePermission in security policy file: 
\ No newline at end of file

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

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

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

Modified: incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java (original)
+++ incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeConfigurationServiceImpl.java Mon May 19 10:49:04 2008
@@ -134,6 +134,11 @@
         
         ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
         
+        // Create a monitor
+        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+        monitor = monitorFactory.createMonitor();
+        
         // Get model factories
         modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
@@ -145,19 +150,14 @@
         // Get and initialize artifact processors
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
         compositeProcessor = (StAXArtifactProcessor<Composite>)staxProcessors.getProcessor(Composite.class);
-        StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
 
         URLArtifactProcessorExtensionPoint urlProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
-        URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors);
+        URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors, monitor);
         
         // Create contribution processor
         modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
-        contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor);
-
-        // Create a monitor
-        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
-        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
-        monitor = monitorFactory.createMonitor();
+        contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor, monitor);
         
         // Create contribution and composite builders
         contributionDependencyBuilder = new ContributionDependencyBuilderImpl(monitor);

Modified: incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java (original)
+++ incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/CompositeGeneratorServiceImpl.java Mon May 19 10:49:04 2008
@@ -57,9 +57,12 @@
 import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.implementation.data.collection.Item;
 import org.apache.tuscany.sca.implementation.data.collection.LocalItemCollection;
 import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
 import org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcessor;
 import org.osoa.sca.annotations.Init;
 import org.osoa.sca.annotations.Reference;
@@ -98,6 +101,11 @@
         
         ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
         
+        // Create a monitor
+        UtilityExtensionPoint services = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+        MonitorFactory monitorFactory = services.getUtility(MonitorFactory.class);
+        Monitor monitor = monitorFactory.createMonitor();
+        
         // Get model factories
         modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
@@ -107,14 +115,14 @@
         // Get and initialize artifact processors
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
         compositeProcessor = (StAXArtifactProcessor<Composite>)staxProcessors.getProcessor(Composite.class);
-        StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
 
         URLArtifactProcessorExtensionPoint urlProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
-        URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors);
+        URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors, monitor);
         
         // Create contribution processor
         modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
-        contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor);
+        contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor, monitor);
     }
     
     @Override

Modified: incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java (original)
+++ incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java Mon May 19 10:49:04 2008
@@ -131,7 +131,7 @@
         // Create artifact processors
         inputFactory = modelFactories.getFactory(XMLInputFactory.class);
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
 
         URLArtifactProcessorExtensionPoint urlProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
         

Modified: incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java (original)
+++ incubator/tuscany/java/sca/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/DeployableCompositeCollectionImpl.java Mon May 19 10:49:04 2008
@@ -105,6 +105,11 @@
         
         ExtensionPointRegistry extensionPoints = domainManagerConfiguration.getExtensionPoints();
         
+        // Create a monitor
+        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+        monitor = monitorFactory.createMonitor();        
+        
         // Get model factories
         modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
         XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
@@ -113,19 +118,14 @@
         
         // Get and initialize artifact processors
         StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+        StAXArtifactProcessor<Object> staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
 
         URLArtifactProcessorExtensionPoint urlProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
-        URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors);
+        URLArtifactProcessor<Object> urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors, monitor);
         
         // Create contribution processor
         modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
-        contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor);
-
-        // Create a monitor
-        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
-        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
-        monitor = monitorFactory.createMonitor();
+        contributionProcessor = new ContributionContentProcessor(modelFactories, modelResolvers, urlProcessor, staxProcessor, monitor);
         
         // Create contribution and composite builders
         contributionDependencyBuilder = new ContributionDependencyBuilderImpl(monitor);

Modified: incubator/tuscany/java/sca/modules/endpoint/src/test/java/org/apace/tuscany/sca/binding/sca/EndpointTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/endpoint/src/test/java/org/apace/tuscany/sca/binding/sca/EndpointTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/endpoint/src/test/java/org/apace/tuscany/sca/binding/sca/EndpointTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/endpoint/src/test/java/org/apace/tuscany/sca/binding/sca/EndpointTestCase.java Mon May 19 10:49:04 2008
@@ -86,6 +86,11 @@
         // Create extension point registry 
         extensionPoints = new DefaultExtensionPointRegistry();
         
+        // Create a monitor
+        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+        Monitor monitor = monitorFactory.createMonitor();        
+        
         modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
                 
         // Initialize the Tuscany module activators
@@ -105,7 +110,7 @@
         
         // Create XML artifact processors
         StAXArtifactProcessorExtensionPoint xmlProcessorExtensions = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        xmlProcessor = new ExtensibleStAXArtifactProcessor(xmlProcessorExtensions, inputFactory, outputFactory);
+        xmlProcessor = new ExtensibleStAXArtifactProcessor(xmlProcessorExtensions, inputFactory, outputFactory, monitor);
         
         // Create contribution content processor
         URLArtifactProcessorExtensionPoint docProcessorExtensions = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
@@ -114,11 +119,6 @@
         // Get the model resolvers
         modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
         modelResolver = new ExtensibleModelResolver(null, modelResolvers, modelFactories);
-        
-        // Create a monitor
-        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
-        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
-        Monitor monitor = monitorFactory.createMonitor();
                
         // Create a composite builder
         SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java Mon May 19 10:49:04 2008
@@ -20,12 +20,9 @@
 package org.apache.tuscany.sca.host.embedded.impl;
 
 import java.io.IOException;
-import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.List;
-import java.util.Set;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.xml.stream.XMLInputFactory;
@@ -81,8 +78,6 @@
 import org.apache.tuscany.sca.core.scope.ScopeRegistryImpl;
 import org.apache.tuscany.sca.core.scope.StatelessScopeContainerFactory;
 import org.apache.tuscany.sca.definitions.SCADefinitions;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
 import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
 import org.apache.tuscany.sca.invocation.MessageFactory;
@@ -226,7 +221,7 @@
             }
         });           
         ExtensibleStAXArtifactProcessor staxProcessor =
-            new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+            new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, monitor);
 
         // Create URL artifact processor extension point
         URLArtifactProcessorExtensionPoint documentProcessors =
@@ -234,7 +229,7 @@
 
         // Create and register document processors for SCA assembly XML
         documentProcessors.getProcessor(Composite.class);
-        documentProcessors.addArtifactProcessor(new CompositeDocumentProcessor(staxProcessor, validatingInputFactory, policyDefinitions));
+        documentProcessors.addArtifactProcessor(new CompositeDocumentProcessor(staxProcessor, validatingInputFactory, policyDefinitions, monitor));
 
         // Create Model Resolver extension point
         ModelResolverExtensionPoint modelResolvers = registry.getExtensionPoint(ModelResolverExtensionPoint.class);
@@ -242,7 +237,7 @@
         // Create contribution package processor extension point
         TypeDescriber describer = new PackageTypeDescriberImpl();
         PackageProcessor packageProcessor =
-            new ExtensiblePackageProcessor(registry.getExtensionPoint(PackageProcessorExtensionPoint.class), describer);
+            new ExtensiblePackageProcessor(registry.getExtensionPoint(PackageProcessorExtensionPoint.class), describer, monitor);
 
         // Create contribution listener
         ExtensibleContributionListener contributionListener =
@@ -251,18 +246,18 @@
         // Create a contribution repository
         ContributionRepository repository;
         try {
-            repository = new ContributionRepositoryImpl("target", inputFactory);
+            repository = new ContributionRepositoryImpl("target", inputFactory, monitor);
         } catch (IOException e) {
             throw new ActivationException(e);
         }
 
-        ExtensibleURLArtifactProcessor documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);
+        ExtensibleURLArtifactProcessor documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, monitor);
 
         // Create the contribution service
         ContributionService contributionService =
             new ContributionServiceImpl(repository, packageProcessor, documentProcessor, staxProcessor,
                                         contributionListener, policyDefinitionResolver, modelResolvers, modelFactories,
-                                        assemblyFactory, contributionFactory, inputFactory, policyDefinitions);
+                                        assemblyFactory, contributionFactory, inputFactory, policyDefinitions, monitor);
         return contributionService;
     }
 

Modified: incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELDocumentProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELDocumentProcessor.java Mon May 19 10:49:04 2008
@@ -22,6 +22,7 @@
 import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
 import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URL;
@@ -37,6 +38,7 @@
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
@@ -54,6 +56,9 @@
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
 import org.apache.tuscany.sca.interfacedef.wsdl.xml.BPELPartnerLinkTypeExt;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * BPEL document processor responsible for reading a BPEL file and producing necessary model info about it
@@ -85,12 +90,57 @@
     
     private final BPELFactory factory;
     private WSDLFactory WSDLfactory;
+    private Monitor monitor;
 
-    public BPELDocumentProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public BPELDocumentProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.factory     = modelFactories.getFactory(BPELFactory.class);
         this.WSDLfactory = modelFactories.getFactory(WSDLFactory.class);
+        this.monitor = monitor;
     }
     
+    /**
+     * Report a warning.
+     * 
+     * @param problems
+     * @param message
+     * @param model
+     */
+     private void warning(String message, Object model, Object... messageParameters) {
+         if (monitor != null) {
+             Problem problem = new ProblemImpl(this.getClass().getName(), "impl-bpel-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
+                                               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-bpel-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-bpel-validation-messages", Severity.ERROR, model, message, ex);
+                                               monitor.problem(problem);
+         }        
+     }
+            
+    
     public String getArtifactType() {
         return "*.bpel";
     }    
@@ -152,7 +202,8 @@
                 if (resolved != null && !resolved.isUnresolved()) {
                     theImport.setWSDLDefinition( resolved );
                 } else {
-                	throw new ContributionResolveException("BPELDocumentProcessor:resolve -" +
+                    error("CannotResolveWSDLReference", resolver, WSDLLocation, WSDLNamespace);
+                    throw new ContributionResolveException("BPELDocumentProcessor:resolve -" +
                 			" unable to resolve WSDL referenced by BPEL import" +
                 			"WSDL location: " + WSDLLocation + " WSDLNamespace: " +
                 			WSDLNamespace );
@@ -176,8 +227,12 @@
     		QName partnerLinkType = thePartnerLink.getPartnerLinkType();
     		BPELPartnerLinkTypeElement pLinkType = 
     			findPartnerLinkType( partnerLinkType, thePLinkTypes );
-    		if( pLinkType == null ) throw new ContributionResolveException( "PartnerLink " 
-    				+ thePartnerLink.getName() + " has no matching partner link type");	
+    		if( pLinkType == null ) {
+    		    error("PartnerLinkNoMatchingType", thePartnerLink, thePartnerLink.getName());
+    		    throw new ContributionResolveException( "PartnerLink " 
+    		        + thePartnerLink.getName() + " has no matching partner link type");
+    		}
+    					
     		thePartnerLink.setPartnerLinkType(pLinkType);
     	} // end for
     	
@@ -227,8 +282,12 @@
     						break;
     					} // end if 
     				} // end for
-    				if( count == 0 ) throw new ContributionResolveException( "partnerLinkType "+ 
-    						                         pLinkElement.getName() +" has no Roles defined" );
+    				if( count == 0 ) {
+    				    error("PartnerLinkTypeNoRoles", theElement, pLinkElement.getName());
+    				    throw new ContributionResolveException( "partnerLinkType " +
+    				        pLinkElement.getName() +" has no Roles defined" );
+    				}
+    						                         
     				thePLinks.add( pLinkElement );
     			} // end if
     			
@@ -393,6 +452,7 @@
 	    String scaReference = reader.getAttributeValue( SCA_BPEL_NS, "reference");
 	    if( (scaService != null) && (scaReference != null) ) {
 	    	// It is incorrect to set both service & reference attributes
+	        error("PartnerLinkHasBothAttr", partnerLink, reader.getAttributeValue(null, "name"));
 	    	throw new ContributionReadException( "BPEL PartnerLink " 
 	    			+ reader.getAttributeValue(null, "name") + 
 	    			" has both sca:reference and sca:service attributes set" );
@@ -420,7 +480,8 @@
 										List<BPELPartnerLinkElement> partnerLinks ) {
 		BPELPartnerLinkElement partnerLink = findPartnerLinkByName( partnerLinks, partnerLinkName );
 		if( partnerLink == null ) {
-			System.out.println("BPEL TypeLoader - element references partnerLink " 
+		    warning("ReferencePartnerLinkNotInList", partnerLinkName, partnerLinkName);
+		    System.out.println("BPEL TypeLoader - element references partnerLink " 
 								+ partnerLinkName + " not in the list");
 		} else {
 			// Set the type of the partnerLink to "service" if not already set...
@@ -435,7 +496,8 @@
 			List<BPELPartnerLinkElement> partnerLinks ) {
 		BPELPartnerLinkElement partnerLink = findPartnerLinkByName( partnerLinks, partnerLinkName );
 		if( partnerLink == null ) {
-			System.out.println("BPEL TypeLoader - element references partnerLink " 
+		    warning("ReferencePartnerLinkNotInList", partnerLinkName, partnerLinkName);
+		    System.out.println("BPEL TypeLoader - element references partnerLink " 
 								+ partnerLinkName + " not in the list");
 		} else {
 			// Set the type of the partnerLink to "service" if not already set...

Modified: incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -37,6 +37,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.processor.BaseStAXArtifactProcessor;
@@ -54,6 +55,9 @@
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
  * Implements a StAX artifact processor for BPEL implementations.
@@ -73,13 +77,29 @@
     private AssemblyFactory assemblyFactory;
     private BPELFactory bpelFactory;
     private WSDLFactory wsdlFactory;
+    private Monitor monitor;
     
-    public BPELImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public BPELImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
         this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
         this.bpelFactory = new DefaultBPELFactory(modelFactories);
+        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-bpel-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+	        monitor.problem(problem);
+    	 }
+    }
+     
     public QName getArtifactType() {
         // Returns the QName of the XML element processed by this processor
         return IMPLEMENTATION_BPEL_QNAME;
@@ -118,6 +138,7 @@
         if( impl != null && impl.isUnresolved()) {
             BPELProcessDefinition processDefinition = resolveBPELProcessDefinition(impl, resolver);
             if(processDefinition.isUnresolved()) {
+            	error("BPELProcessNotFound", impl, processDefinition.getName());
                 throw new ContributionResolveException("Can't find BPEL Process : " + processDefinition.getName());
             }
             
@@ -242,6 +263,7 @@
         } // end if
         // No interfaces mean an error - throw an exception
         if( callPT == null && callbackPT == null ) {
+        	error("MyRolePartnerRoleNull", theInterfaces);
         	throw new ContributionResolveException("Error: myRole and partnerRole port types are both null");
         } // end if 
         
@@ -258,6 +280,7 @@
         } // end for
         // Throw an exception if no interface is found
         if( callInterface == null ) {
+        	error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
         	throw new ContributionResolveException("Interface not found for port type " +
         			callPT.getQName().toString() );
         } // end if 
@@ -272,6 +295,7 @@
             } // end for
             // Throw an exception if no interface is found
             if( callbackInterface == null ) {
+            	error("NoInterfaceForPortType", theInterfaces, callbackPT.getQName().toString());
             	throw new ContributionResolveException("Interface not found for port type " +
             			callbackPT.getQName().toString() );
             } // end if 
@@ -314,6 +338,7 @@
         } // end if
         // No interfaces mean an error - throw an exception
         if( callPT == null && callbackPT == null ) {
+        	error("MyRolePartnerRoleNull", theInterfaces);
         	throw new ContributionResolveException("Error: myRole and partnerRole port types are both null");
         } // end if 
 
@@ -325,6 +350,7 @@
         } // end for
         // Throw an exception if no interface is found
         if( callInterface == null ) {
+        	error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
         	throw new ContributionResolveException("Interface not found for port type " +
         			callPT.getQName().toString() );
         } // end if 
@@ -340,6 +366,7 @@
             } // end for
             // Throw an exception if no interface is found
             if( callbackInterface == null ) {
+            	error("NoInterfaceForPortType", theInterfaces, callbackPT.getQName().toString());
             	throw new ContributionResolveException("Interface not found for port type " +
             			callbackPT.getQName().toString() );
             } // end if 
@@ -470,6 +497,7 @@
         	} catch ( IllegalArgumentException e ) {
         		// This exception happens if the attribute begins with '{' but doesn't conform
         		// to the XML Namespaces recommendation format
+        		error("AttributeWithoutNamespace", reader, attribute, fullValue);
         		throw new BPELProcessException("Attribute " + attribute + " with value " + fullValue +
                 " in your composite should be of the form {namespaceURI}localname");
         	}
@@ -482,9 +510,11 @@
         String prefix = fullValue.substring(0, fullValue.indexOf(":"));
         String name = fullValue.substring(fullValue.indexOf(":") + 1);
         String nsUri = reader.getNamespaceContext().getNamespaceURI(prefix);
-        if (nsUri == null)
+        if (nsUri == null) {
+        	error("AttributeUnrecognizedNamespace", reader, attribute, fullValue);
             throw new BPELProcessException("Attribute " + attribute + " with value " + fullValue +
                     " in your composite has un unrecognized namespace prefix.");
+        }
         return new QName(nsUri, name, prefix);
     }
 

Added: incubator/tuscany/java/sca/modules/implementation-bpel/src/main/resources/impl-bpel-validation-messages.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel/src/main/resources/impl-bpel-validation-messages.properties?rev=657881&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-bpel/src/main/resources/impl-bpel-validation-messages.properties (added)
+++ incubator/tuscany/java/sca/modules/implementation-bpel/src/main/resources/impl-bpel-validation-messages.properties Mon May 19 10:49:04 2008
@@ -0,0 +1,32 @@
+#
+#
+#    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.
+#
+#
+CannotResolveWSDLReference = BPELDocumentProcessor:resolve - unable to resolve WSDL referenced by BPEL import WSDL location: {0} WSDLNamespace: {1}
+ContributionReadException = ContributionReadException occured due to :
+PartnerLinkNoMatchingType = PartnerLink {0} has no matching partner link type
+PartnerLinkTypeNoRoles = PartnerLinkType {0} has no Roles defined
+ContributionResolveException = ContributionResolveException occured due to :
+PartnerLinkHasBothAttr = BPEL PartnerLink {0} has both sca:reference and sca:service attributes set
+ReferencePartnerLinkNotInList = BPEL TypeLoader - element references partnerLink {0} not in the list
+MyRolePartnerRoleNull = Error: myRole and partnerRole port types are both null
+NoInterfaceForPortType = Interface not found for port type {0}
+AttributeWithoutNamespace = Attribute {0} with value {1} in your composite should be of the form {namespaceURI}localname
+AttributeUnrecognizedNamespace = Attribute {0} with value {1} in your composite has un unrecognized namespace prefix.
+BPELProcessNotFound = Can't find BPEL Process : {0}
\ No newline at end of file

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

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

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

Modified: incubator/tuscany/java/sca/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELDocumentProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELDocumentProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELDocumentProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELDocumentProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -44,7 +44,7 @@
     protected void setUp() throws Exception {
         DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
         URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
-        documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);
+        documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
     }
 
     public void testLoadBPELProcessDefinition() throws Exception {

Modified: incubator/tuscany/java/sca/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementationProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementationProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementationProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-bpel/src/test/java/org/apache/tuscany/sca/implementation/bpel/BPELImplementationProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -66,7 +66,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);
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessor.java Mon May 19 10:49:04 2008
@@ -43,6 +43,7 @@
 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;
 
 
 /**
@@ -62,16 +63,15 @@
     
     private final AssemblyFactory assemblyFactory;
     private final JavaInterfaceFactory javaFactory;
-    
+    private Monitor monitor;
     private StAXArtifactProcessor<ConnectionInfo> connectionInfoProcessor;
     
-    public DASImplementationProcessor(ModelFactoryExtensionPoint modelFactories) {
+    public DASImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
         assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
         javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
-        
-        this.dasFactory = new DefaultDASImplementationFactory(assemblyFactory, javaFactory);
-        
-        this.connectionInfoProcessor = new ConnectionInfoArtifactProcessor(modelFactories);
+        this.monitor = monitor;
+        this.dasFactory = new DefaultDASImplementationFactory(assemblyFactory, javaFactory);        
+        this.connectionInfoProcessor = new ConnectionInfoArtifactProcessor(modelFactories, this.monitor);
     }
 
     public QName getArtifactType() {

Modified: incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java?rev=657881&r1=657880&r2=657881&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASImplementationProcessorTestCase.java Mon May 19 10:49:04 2008
@@ -86,7 +86,7 @@
     public void testLoadCompositeUsingDatasource() throws Exception {
         XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_DATASOURCE));
         
-        DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories);
+        DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories, null);
         
         while(true) {
             int event = reader.next();
@@ -112,7 +112,7 @@
     public void testLoadCompositeUsingConnectionProperties() throws Exception {
         XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(COMPOSITE_USING_CONNECTION_PROPERTIES));
 
-        DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories);
+        DASImplementationProcessor dataProcessor = new DASImplementationProcessor(modelFactories, null);
         
         while(true) {
             int event = reader.next();



Mime
View raw message