tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r988675 - in /tuscany/sca-java-1.x/branches/sca-java-1.6.1: itest/jms/src/main/resources/external/ modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/co...
Date Tue, 24 Aug 2010 19:12:30 GMT
Author: nash
Date: Tue Aug 24 19:12:29 2010
New Revision: 988675

URL: http://svn.apache.org/viewvc?rev=988675&view=rev
Log:
Merge revision 921286 from trunk into the 1.6.1 branch

Modified:
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/itest/jms/src/main/resources/external/client.composite
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java
    tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/itest/jms/src/main/resources/external/client.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/itest/jms/src/main/resources/external/client.composite?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/itest/jms/src/main/resources/external/client.composite (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/itest/jms/src/main/resources/external/client.composite Tue Aug 24 19:12:29 2010
@@ -1,38 +1,38 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.    
- -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
-           name="ExternalClientComposite">
-
-    <component name="HelloWorldClient">
-        <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
-        <reference name="serviceA" />
-    </component>
-
-    <reference name="serviceA" promote="HelloWorldClient/serviceA">
-        <interface.java interface="org.apache.tuscany.sca.binding.jms.HelloWorldService" />
-        <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
-            <destination name="DestQueueA"/>
-            <response>
-               <destination name="RespQueueA"/>
-            </response>
-        </binding.jms>  
-    </reference>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+ -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+           name="ExternalClientComposite">
+
+    <component name="HelloWorldClient">
+        <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
+        <reference name="serviceA" />
+    </component>
+
+    <reference name="serviceA" promote="HelloWorldClient/serviceA">
+        <interface.java interface="org.apache.tuscany.sca.binding.jms.HelloWorldService" />
+        <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61616">
+            <destination name="  DestQueueA  "/>
+            <response>
+               <destination name="RespQueueA"/>
+            </response>
+        </binding.jms>  
+    </reference>
+
+</composite>

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java Tue Aug 24 19:12:29 2010
@@ -180,7 +180,7 @@ public class CompositeProcessor extends 
                             // Read a <composite>
                             composite = assemblyFactory.createComposite();
                             
-                            composite.setName(new QName(getString(reader, TARGET_NAMESPACE), getString(reader, NAME)));
+                            composite.setName(new QName(getURIString(reader, TARGET_NAMESPACE), getString(reader, NAME)));
     
                             if(!isSet(reader, TARGET_NAMESPACE)){
                                 // spec says that a composite must have a namespace
@@ -227,7 +227,7 @@ public class CompositeProcessor extends 
                                 contract = compositeService;
                                 compositeService.setName(getString(reader, NAME));
     
-                                String promoted = getString(reader, PROMOTE);
+                                String promoted = getURIString(reader, PROMOTE);
                                 if (promoted != null) {
                                     String promotedComponentName;
                                     String promotedServiceName;
@@ -283,7 +283,7 @@ public class CompositeProcessor extends 
                                 compositeReference.setName(getString(reader, NAME));
                                 readMultiplicity(compositeReference, reader);
                                 readTargets(compositeReference, reader);
-                                String promote = reader.getAttributeValue(null, Constants.PROMOTE);
+                                String promote = getString(reader, Constants.PROMOTE);
                                 if (promote != null) {
                                     for (StringTokenizer tokens = new StringTokenizer(promote); tokens.hasMoreTokens();) {
                                         ComponentReference promotedReference =
@@ -337,7 +337,7 @@ public class CompositeProcessor extends 
                                         //throw ce;
                                     }
                                 }
-                                componentProperty.setFile(getString(reader, FILE));
+                                componentProperty.setFile(getURIString(reader, FILE));
                                 
                                 //handle extension attributes
                                 this.readExtendedAttributes(reader, componentProperty);
@@ -380,7 +380,7 @@ public class CompositeProcessor extends 
                                 component.setAutowire(getBoolean(reader, AUTOWIRE));
                             }
                             if (isSet(reader, URI)) {
-                                component.setURI(getString(reader, URI));
+                                component.setURI(getURIString(reader, URI));
                             }
                             
                             //handle extension attributes
@@ -396,12 +396,12 @@ public class CompositeProcessor extends 
                             wire = assemblyFactory.createWire();
                             ComponentReference source = assemblyFactory.createComponentReference();
                             source.setUnresolved(true);
-                            source.setName(getString(reader, SOURCE));
+                            source.setName(getURIString(reader, SOURCE));
                             wire.setSource(source);
     
                             ComponentService target = assemblyFactory.createComponentService();
                             target.setUnresolved(true);
-                            target.setName(getString(reader, TARGET));
+                            target.setName(getURIString(reader, TARGET));
                             wire.setTarget(target);
     
                             //handle extension attributes

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/DefaultBeanModelProcessor.java Tue Aug 24 19:12:29 2010
@@ -144,7 +144,12 @@ public class DefaultBeanModelProcessor<T
                 String attributeName = reader.getAttributeLocalName(i);
                 Method setter = setterMethods.get(attributeName);
                 if (setter != null) {
-                    String value = reader.getAttributeValue(i);
+                	String value = null;
+                	if (attributeName.equals("uri")){
+                		value = getURIString(reader, "uri");
+                	} else {
+                		value = reader.getAttributeValue(i);
+                	}
                     setter.invoke(model, value);
                 }
             }

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-corba/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaBindingProcessor.java Tue Aug 24 19:12:29 2010
@@ -28,6 +28,7 @@ import org.apache.tuscany.sca.assembly.x
 import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
 import org.apache.tuscany.sca.binding.corba.CorbaBinding;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+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;
@@ -38,7 +39,7 @@ import org.apache.tuscany.sca.policy.Pol
 /**
  * @version $Rev$ $Date$
  */
-public class CorbaBindingProcessor implements StAXArtifactProcessor<CorbaBinding> {
+public class CorbaBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<CorbaBinding> {
     private PolicyFactory policyFactory;
     private PolicyAttachPointProcessor policyProcessor;
 
@@ -76,7 +77,7 @@ public class CorbaBindingProcessor imple
         }
 
         // Read binding URI
-        String uri = reader.getAttributeValue(null, "uri");
+        String uri = getURIString(reader, "uri");
         if (uri != null) {
             binding.setURI(uri);
         }

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ejb/src/main/java/org/apache/tuscany/sca/binding/ejb/impl/EJBBindingProcessor.java Tue Aug 24 19:12:29 2010
@@ -31,6 +31,7 @@ import org.apache.tuscany.sca.assembly.x
 import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
 import org.apache.tuscany.sca.binding.ejb.EJBBinding;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXAttributeProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
@@ -68,7 +69,7 @@ import org.apache.tuscany.sca.monitor.im
  *
  * @version $Rev$ $Date$
  */
-public class EJBBindingProcessor implements StAXArtifactProcessor<EJBBindingImpl> {
+public class EJBBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<EJBBindingImpl> {
     private PolicyFactory policyFactory;
     private ExtensionFactory extensionFactory;
     private PolicyAttachPointProcessor policyProcessor;
@@ -132,7 +133,7 @@ public class EJBBindingProcessor impleme
         }
 
         // Read binding URI
-        String uri = reader.getAttributeValue(null, EJBBinding.URI);
+        String uri = getURIString(reader, EJBBinding.URI);
         if (uri != null) {
             ejbBinding.setURI(uri);
         }

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/impl/GdataBindingProcessor.java Tue Aug 24 19:12:29 2010
@@ -26,6 +26,7 @@ import javax.xml.stream.XMLStreamWriter;
 import org.apache.tuscany.sca.binding.gdata.GdataBinding;
 import org.apache.tuscany.sca.binding.gdata.GdataBindingFactory;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+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;
@@ -37,7 +38,7 @@ import org.apache.tuscany.sca.contributi
  * 
  * @version $Rev$ $Date$
  */
-public class GdataBindingProcessor implements StAXArtifactProcessor<GdataBinding> {
+public class GdataBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<GdataBinding> {
 
     private QName BINDING_GDATA = new QName("http://tuscany.apache.org/xmlns/sca/1.0", "binding.gdata");
     
@@ -64,7 +65,7 @@ public class GdataBindingProcessor imple
     		gdataBinding.setName(name);
     	}
 
-    	String uri = reader.getAttributeValue(null, "uri");
+    	String uri = getURIString(reader, "uri");
     	if (uri != null) {
     		gdataBinding.setURI(uri);
     	}

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java Tue Aug 24 19:12:29 2010
@@ -102,7 +102,7 @@ public class HTTPBindingProcessor extend
                              httpBinding.setName(name);
                          }
                          
-                         String uri = getString(reader, URI);
+                         String uri = getURIString(reader, URI);
                          if (uri != null) {
                              httpBinding.setURI(uri);
                          }

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessor.java Tue Aug 24 19:12:29 2010
@@ -219,13 +219,13 @@ public class JMSBindingProcessor extends
         }
 
         // Read initial context factory
-        String initialContextFactory = reader.getAttributeValue(null, "initialContextFactory");
+        String initialContextFactory = getURIString(reader, "initialContextFactory");
         if (initialContextFactory != null && initialContextFactory.length() > 0) {
             jmsBinding.setInitialContextFactoryName(initialContextFactory);
         }
 
         // Read JNDI URL
-        String jndiURL = reader.getAttributeValue(null, "jndiURL");
+        String jndiURL = getURIString(reader, "jndiURL");
         if (jndiURL != null && jndiURL.length() > 0) {
             jmsBinding.setJndiURL(jndiURL);
         }
@@ -407,7 +407,7 @@ public class JMSBindingProcessor extends
     }
 
     private void parseDestination(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
-        String name = reader.getAttributeValue(null, "name");
+        String name = getURIString(reader, "name");
         if (name != null && name.length() > 0) {
             jmsBinding.setDestinationName(name);
         }
@@ -433,7 +433,7 @@ public class JMSBindingProcessor extends
     }
 
     private void parseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
-        String name = reader.getAttributeValue(null, "name");
+        String name = getURIString(reader, "name");
         if (name != null && name.length() > 0) {
             jmsBinding.setConnectionFactoryName(name);
         } else {
@@ -443,7 +443,7 @@ public class JMSBindingProcessor extends
     }
 
     private void parseActivationSpec(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
-        String name = reader.getAttributeValue(null, "name");        
+        String name = getURIString(reader, "name");        
         if (name != null && name.length() > 0) {
             jmsBinding.setActivationSpecName(name);            
         } else {
@@ -453,7 +453,7 @@ public class JMSBindingProcessor extends
     }
 
     private void parseResponseDestination(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
-        String name = reader.getAttributeValue(null, "name");
+        String name = getURIString(reader, "name");
         if (name != null && name.length() > 0) {
             jmsBinding.setResponseDestinationName(name);
         }
@@ -479,7 +479,7 @@ public class JMSBindingProcessor extends
     }
 
     private void parseResponseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
-        String name = reader.getAttributeValue(null, "name");
+        String name = getURIString(reader, "name");
         if (name != null && name.length() > 0) {
             jmsBinding.setResponseConnectionFactoryName(name);            
         } else {
@@ -489,7 +489,7 @@ public class JMSBindingProcessor extends
     }
 
     private void parseResponseActivationSpec(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
-        String name = reader.getAttributeValue(null, "name");
+        String name = getURIString(reader, "name");
         if (name != null && name.length() > 0) {
             jmsBinding.setResponseActivationSpecName(name);            
         } else {

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java Tue Aug 24 19:12:29 2010
@@ -33,6 +33,7 @@ import org.apache.tuscany.sca.assembly.S
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
@@ -51,7 +52,7 @@ import org.apache.tuscany.sca.policy.Pol
  * @version $Rev$ $Date$
  */
 
-public class SCABindingProcessor implements StAXArtifactProcessor<SCABinding>, Constants{
+public class SCABindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<SCABinding>, Constants{
 
     private SCABindingFactory scaBindingFactory;
     private ExtensionFactory extensionFactory;
@@ -106,7 +107,7 @@ public class SCABindingProcessor impleme
         }
 
         // Read binding URI
-        String uri = reader.getAttributeValue(null, URI);
+        String uri = getURIString(reader, URI);
         if (uri != null) {
             scaBinding.setURI(uri);
         }

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java Tue Aug 24 19:12:29 2010
@@ -47,6 +47,7 @@ import org.apache.tuscany.sca.binding.ws
 import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
 import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXAttributeProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
@@ -77,7 +78,7 @@ import com.ibm.wsdl.OperationImpl;
  *
  * @version $Rev$ $Date$
  */
-public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServiceBinding>, WebServiceConstants {
+public class WebServiceBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<WebServiceBinding>, WebServiceConstants {
 
     private ExtensionPointRegistry extensionPoints;
     private WSDLFactory wsdlFactory;
@@ -172,7 +173,7 @@ public class WebServiceBindingProcessor 
         }
 
         // Read URI
-        String uri = reader.getAttributeValue(null, URI);
+        String uri = getURIString(reader, URI);
         if (uri != null) {
             wsBinding.setURI(uri);
         }
@@ -180,7 +181,7 @@ public class WebServiceBindingProcessor 
         // Read a qname in the form:
         // namespace#wsdl.???(name)
         Boolean wsdlElementIsBinding = null;
-        String wsdlElement = reader.getAttributeValue(null, WSDL_ELEMENT);
+        String wsdlElement = getURIString(reader, WSDL_ELEMENT);
         if (wsdlElement != null) {
             int index = wsdlElement.indexOf('#');
             if (index == -1) {

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportProcessor.java Tue Aug 24 19:12:29 2010
@@ -30,6 +30,7 @@ import javax.xml.stream.XMLStreamWriter;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.java.JavaImport;
 import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory;
+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;
@@ -45,7 +46,7 @@ import org.apache.tuscany.sca.monitor.im
  * 
  * @version $Rev$ $Date$
  */
-public class JavaImportProcessor  implements StAXArtifactProcessor<JavaImport> {
+public class JavaImportProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<JavaImport> {
     private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
     
     private static final QName IMPORT_JAVA = new QName(SCA10_NS, "import.java");
@@ -121,7 +122,7 @@ public class JavaImportProcessor  implem
                             } else
                             	javaImport.setPackage(packageName);
                             
-                            String location = reader.getAttributeValue(null, LOCATION);                        
+                            String location = getURIString(reader, LOCATION);                        
                             javaImport.setLocation(location);
                         }
                         break;

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution-namespace/src/main/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceImportProcessor.java Tue Aug 24 19:12:29 2010
@@ -133,7 +133,7 @@ public class NamespaceImportProcessor ex
                                 namespaceImport.setNamespace(ns);
                             }
 
-                            String location = reader.getAttributeValue(null, LOCATION);
+                            String location = getURIString(reader, LOCATION);
                             if (location != null) {
                                 namespaceImport.setLocation(location);
                             }

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/BaseStAXArtifactProcessor.java Tue Aug 24 19:12:29 2010
@@ -123,6 +123,71 @@ public abstract class BaseStAXArtifactPr
     protected String getString(XMLStreamReader reader, String name) {
         return reader.getAttributeValue(null, name);
     }
+    
+    /**
+     * TUSCANY-242
+     * 
+     * Returns the URI value of an attribute as a string and first applies the 
+     * URI whitespace processing as defined in section 4.3.6 of XML Schema Part2: Datatypes
+     * [http://www.w3.org/TR/xmlschema-2/#rf-facets]. anyURI is defined with the following 
+     * XSD:
+     *   <xs:simpleType name="anyURI" id="anyURI">
+     *        <xs:restriction base="xs:anySimpleType">
+     *          <xs:whiteSpace value="collapse" fixed="true" id="anyURI.whiteSpace"/>
+     *        </xs:restriction>
+     *   </xs:simpleType>
+     *   
+     * The <xs:whiteSpace value="collapse"/> constraining facet is defined as follows
+     * 
+     *   replace
+     *      All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) are replaced with #x20 (space) 
+     *   collapse
+     *      After the processing implied by replace, contiguous sequences of #x20's are collapsed to a single #x20, 
+     *      and leading and trailing #x20's are removed
+     *      
+     * It seems that the StAX parser does apply this rule so we do it here. 
+     * 
+     * @param reader
+     * @param name
+     * @return
+     */
+    public static String getURIString(XMLStreamReader reader, String name) {
+        // get the basic string value
+        String uri = reader.getAttributeValue(null, name);
+        
+        // apply the "collapse" rule
+        if (uri != null){
+            // turn tabs, line feeds and carriage returns into spaces
+            uri = uri.replace('\t', ' ');
+            uri = uri.replace('\n', ' ');
+            uri = uri.replace('\r', ' ');
+            
+            // remote leading and trailing spaces. Other whitespace
+            // has already been converted to spaces above
+            uri = uri.trim();
+                        
+            // collapse any contiguous spaces into a single space
+            StringBuilder sb= new StringBuilder(uri.length());
+            boolean spaceFound= false;
+            for(int i=0; i< uri.length(); ++i){
+                char c= uri.charAt(i);
+                if(c == ' '){
+                    if(!spaceFound){
+                        sb.append(c);
+                        spaceFound = true;
+                    } else {
+                        // collapse the space by ignoring it
+                    }
+                }else{
+                    sb.append(c);
+                    spaceFound= false;
+                }
+            }     
+            uri = sb.toString();            
+        }
+        
+        return uri;
+    }    
 
     /**
      * Test if an attribute is explicitly set

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/SCADefinitionsProcessor.java Tue Aug 24 19:12:29 2010
@@ -97,7 +97,7 @@ public class SCADefinitionsProcessor ext
                     name = reader.getName();
                     if ( SCA_DEFINITIONS_QNAME.equals(name)) {
                         definitions = new SCADefinitionsImpl();
-                        targetNamespace = reader.getAttributeValue(null, TARGET_NAMESPACE);
+                        targetNamespace = getURIString(reader, TARGET_NAMESPACE);
                         definitions.setTargetNamespace(targetNamespace);
                     } else {
                         Object extension = extensionProcessor.read(reader);

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java Tue Aug 24 19:12:29 2010
@@ -32,6 +32,7 @@ import org.apache.tuscany.sca.assembly.x
 import org.apache.tuscany.sca.contribution.Artifact;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+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;
@@ -50,7 +51,7 @@ import org.apache.tuscany.sca.monitor.im
  *
  * @version $Rev$ $Date$
  */
-public class ResourceImplementationProcessor implements StAXArtifactProcessor<ResourceImplementation> {
+public class ResourceImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<ResourceImplementation> {
     private static final QName IMPLEMENTATION_RESOURCE = new QName(Constants.SCA10_TUSCANY_NS, "implementation.resource");
     
     private ContributionFactory contributionFactory;
@@ -109,7 +110,7 @@ public class ResourceImplementationProce
         ResourceImplementation implementation = null;
 
         // Read the location attribute specifying the location of the resources
-        String location = reader.getAttributeValue(null, "location");
+        String location = getURIString(reader, "location");
         if (location != null) {
             implementation = implementationFactory.createResourceImplementation();
             implementation.setLocation(location);

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java Tue Aug 24 19:12:29 2010
@@ -1,234 +1,235 @@
-/*
- * 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.spring.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import javax.xml.namespace.QName;
-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.ComponentType;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-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.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.implementation.spring.introspect.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;
+/*
+ * 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.spring.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import javax.xml.namespace.QName;
+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.ComponentType;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+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.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.implementation.spring.introspect.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.monitor.impl.ProblemImpl;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * SpringArtifactProcessor is responsible for processing the XML of an <implementation.spring.../>
- * element in an SCA SCDL file.
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringImplementationProcessor implements StAXArtifactProcessor<SpringImplementation> {
-
-    private static final String LOCATION = "location";
-    private static final String IMPLEMENTATION_SPRING = "implementation.spring";
-    private static final QName IMPLEMENTATION_SPRING_QNAME = new QName(Constants.SCA10_NS, IMPLEMENTATION_SPRING);
-    private static final String MSG_LOCATION_MISSING = "Reading implementation.spring - location attribute missing";
-
-    private AssemblyFactory assemblyFactory;
-    private JavaInterfaceFactory javaFactory;
-    private PolicyFactory policyFactory;
-    private PolicyAttachPointProcessor policyProcessor;
-    private Monitor monitor;
-
-    private ModelFactoryExtensionPoint factories;
-
-    public SpringImplementationProcessor(ExtensionPointRegistry extensionPoints, Monitor monitor) {
-        this.factories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);    	
-        this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
-        this.javaFactory = factories.getFactory(JavaInterfaceFactory.class);
-        this.policyFactory = factories.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);
-    	 }
-    }
-
-    /*
-     * Read the XML and parse out the attributes.
-     *
-     * <implementation.spring.../> has a single required attribute:
-     * "location" - which is the target URI of of an archive file or a directory that contains the Spring
-     * application context files.
-     * If the resource identified by the location attribute is an archive file, then the file
-     * META-INF/MANIFEST.MF is read from the archive.
-     * If the location URI identifies a directory, then META-INF/MANIFEST.MF must exist
-     * underneath that directory.
-     * If the manifest file contains a header "Spring-Context" of the format:
-     *    Spring-Context ::= path ( ';' path )*
-     *
-     * Where path is a relative path with respect to the location URI, then the set of paths
-     * specified in the header identify the context configuration files.
-     * If there is no MANIFEST.MF file or no Spring-Context header within that file,
-     * then the default behaviour is to build an application context using all the *.xml files
-     * in the METAINF/spring directory.
-     */
-    public SpringImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
-        // Create the Spring implementation
-        SpringImplementation springImplementation = null;
-
-        // Read the location attribute for the spring implementation
-        String springLocation = reader.getAttributeValue(null, LOCATION);
-        if (springLocation != null) {
-        	springImplementation = new SpringImplementation();
-        	springImplementation.setLocation(springLocation);
-        	springImplementation.setUnresolved(true);
-            processComponentType(springImplementation);
-        } else {
-        	error("LocationAttributeMissing", reader);
-            //throw new ContributionReadException(MSG_LOCATION_MISSING);
-        }
-
-        // Read policies
-        policyProcessor.readPolicies(springImplementation, reader);
-
-        // Skip to end element
-        while (reader.hasNext()) {
-            if (reader.next() == END_ELEMENT && IMPLEMENTATION_SPRING_QNAME.equals(reader.getName())) {
-                break;
-            }
-        } // end while
-
-        return springImplementation;
-    } // end read
-
-    /*
-     * Handles the component type for the Spring implementation
-     * @param springImplementation - a Spring implementation.  The component type information
-     * is created for this implementation
-     *
-     */
-    private void processComponentType(SpringImplementation springImplementation) {
-
-        // Create a ComponentType and mark it unresolved
-        ComponentType componentType = assemblyFactory.createComponentType();
-        componentType.setUnresolved(true);
-        springImplementation.setComponentType(componentType);
-    } // end processComponentType
-
-    /*
-     * Write out the XML representation of the Spring implementation
-     * <implementation.spring location="..." />
-     */
-    public void write(SpringImplementation springImplementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
-        // Write <implementation.spring>
-        writer.writeStartElement(Constants.SCA10_NS, IMPLEMENTATION_SPRING);
-        policyProcessor.writePolicyAttributes(springImplementation, writer);
-
-        if (springImplementation.getLocation() != null) {
-            writer.writeAttribute(LOCATION, springImplementation.getLocation());
-        }
-
-        writer.writeEndElement();
-
-    } // end write
-
-    /**
-     * Resolves the Spring implementation - loads the Spring application-context XML and
-     * derives the spring implementation componentType from it
-     */
-    public void resolve(SpringImplementation springImplementation, ModelResolver resolver)
-        throws ContributionResolveException {
-
-    	if (springImplementation == null)
-    		return;
-
-        /* Load the Spring component type by reading the Spring application context */
-        SpringXMLComponentTypeLoader springLoader =
-            new SpringXMLComponentTypeLoader(factories, assemblyFactory, javaFactory, policyFactory);
-        try {
-            // Load the Spring Implementation information from its application context file...
-            springLoader.load(springImplementation, resolver);
-        } catch (ContributionReadException e) {
-        	ContributionResolveException ce = new ContributionResolveException(e);
-        	error("ContributionResolveException", resolver, ce);
-            throw ce;
-        }
-
-        ComponentType ct = springImplementation.getComponentType();
-        if (ct.isUnresolved()) {
-            // If the introspection fails to resolve, try to find a side file...
-            ComponentType componentType = resolver.resolveModel(ComponentType.class, ct);
-            if (componentType.isUnresolved()) {
-            	error("UnableToResolveComponentType", resolver);
-                //throw new ContributionResolveException("SpringArtifactProcessor: unable to resolve componentType for Spring component");
-            } else {
-                springImplementation.setComponentType(componentType);
-                springImplementation.setUnresolved(false);
-           }
-
-        } // end if
-
-    } // end method resolve
-
-    public QName getArtifactType() {
-        return IMPLEMENTATION_SPRING_QNAME;
-    }
-
-    public Class<SpringImplementation> getModelType() {
-        return SpringImplementation.class;
-    }
-
-} // end class SpringArtifactProcessor
+import org.apache.tuscany.sca.policy.PolicyFactory;
+
+/**
+ * SpringArtifactProcessor is responsible for processing the XML of an <implementation.spring.../>
+ * element in an SCA SCDL file.
+ *
+ * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
+ */
+public class SpringImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<SpringImplementation> {
+
+    private static final String LOCATION = "location";
+    private static final String IMPLEMENTATION_SPRING = "implementation.spring";
+    private static final QName IMPLEMENTATION_SPRING_QNAME = new QName(Constants.SCA10_NS, IMPLEMENTATION_SPRING);
+    private static final String MSG_LOCATION_MISSING = "Reading implementation.spring - location attribute missing";
+
+    private AssemblyFactory assemblyFactory;
+    private JavaInterfaceFactory javaFactory;
+    private PolicyFactory policyFactory;
+    private PolicyAttachPointProcessor policyProcessor;
+    private Monitor monitor;
+
+    private ModelFactoryExtensionPoint factories;
+
+    public SpringImplementationProcessor(ExtensionPointRegistry extensionPoints, Monitor monitor) {
+        this.factories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);    	
+        this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
+        this.javaFactory = factories.getFactory(JavaInterfaceFactory.class);
+        this.policyFactory = factories.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);
+    	 }
+    }
+
+    /*
+     * Read the XML and parse out the attributes.
+     *
+     * <implementation.spring.../> has a single required attribute:
+     * "location" - which is the target URI of of an archive file or a directory that contains the Spring
+     * application context files.
+     * If the resource identified by the location attribute is an archive file, then the file
+     * META-INF/MANIFEST.MF is read from the archive.
+     * If the location URI identifies a directory, then META-INF/MANIFEST.MF must exist
+     * underneath that directory.
+     * If the manifest file contains a header "Spring-Context" of the format:
+     *    Spring-Context ::= path ( ';' path )*
+     *
+     * Where path is a relative path with respect to the location URI, then the set of paths
+     * specified in the header identify the context configuration files.
+     * If there is no MANIFEST.MF file or no Spring-Context header within that file,
+     * then the default behaviour is to build an application context using all the *.xml files
+     * in the METAINF/spring directory.
+     */
+    public SpringImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+
+        // Create the Spring implementation
+        SpringImplementation springImplementation = null;
+
+        // Read the location attribute for the spring implementation
+        String springLocation = getURIString(reader, LOCATION);
+        if (springLocation != null) {
+        	springImplementation = new SpringImplementation();
+        	springImplementation.setLocation(springLocation);
+        	springImplementation.setUnresolved(true);
+            processComponentType(springImplementation);
+        } else {
+        	error("LocationAttributeMissing", reader);
+            //throw new ContributionReadException(MSG_LOCATION_MISSING);
+        }
+
+        // Read policies
+        policyProcessor.readPolicies(springImplementation, reader);
+
+        // Skip to end element
+        while (reader.hasNext()) {
+            if (reader.next() == END_ELEMENT && IMPLEMENTATION_SPRING_QNAME.equals(reader.getName())) {
+                break;
+            }
+        } // end while
+
+        return springImplementation;
+    } // end read
+
+    /*
+     * Handles the component type for the Spring implementation
+     * @param springImplementation - a Spring implementation.  The component type information
+     * is created for this implementation
+     *
+     */
+    private void processComponentType(SpringImplementation springImplementation) {
+
+        // Create a ComponentType and mark it unresolved
+        ComponentType componentType = assemblyFactory.createComponentType();
+        componentType.setUnresolved(true);
+        springImplementation.setComponentType(componentType);
+    } // end processComponentType
+
+    /*
+     * Write out the XML representation of the Spring implementation
+     * <implementation.spring location="..." />
+     */
+    public void write(SpringImplementation springImplementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+
+        // Write <implementation.spring>
+        writer.writeStartElement(Constants.SCA10_NS, IMPLEMENTATION_SPRING);
+        policyProcessor.writePolicyAttributes(springImplementation, writer);
+
+        if (springImplementation.getLocation() != null) {
+            writer.writeAttribute(LOCATION, springImplementation.getLocation());
+        }
+
+        writer.writeEndElement();
+
+    } // end write
+
+    /**
+     * Resolves the Spring implementation - loads the Spring application-context XML and
+     * derives the spring implementation componentType from it
+     */
+    public void resolve(SpringImplementation springImplementation, ModelResolver resolver)
+        throws ContributionResolveException {
+
+    	if (springImplementation == null)
+    		return;
+
+        /* Load the Spring component type by reading the Spring application context */
+        SpringXMLComponentTypeLoader springLoader =
+            new SpringXMLComponentTypeLoader(factories, assemblyFactory, javaFactory, policyFactory);
+        try {
+            // Load the Spring Implementation information from its application context file...
+            springLoader.load(springImplementation, resolver);
+        } catch (ContributionReadException e) {
+        	ContributionResolveException ce = new ContributionResolveException(e);
+        	error("ContributionResolveException", resolver, ce);
+            throw ce;
+        }
+
+        ComponentType ct = springImplementation.getComponentType();
+        if (ct.isUnresolved()) {
+            // If the introspection fails to resolve, try to find a side file...
+            ComponentType componentType = resolver.resolveModel(ComponentType.class, ct);
+            if (componentType.isUnresolved()) {
+            	error("UnableToResolveComponentType", resolver);
+                //throw new ContributionResolveException("SpringArtifactProcessor: unable to resolve componentType for Spring component");
+            } else {
+                springImplementation.setComponentType(componentType);
+                springImplementation.setUnresolved(false);
+           }
+
+        } // end if
+
+    } // end method resolve
+
+    public QName getArtifactType() {
+        return IMPLEMENTATION_SPRING_QNAME;
+    }
+
+    public Class<SpringImplementation> getModelType() {
+        return SpringImplementation.class;
+    }
+
+} // end class SpringArtifactProcessor

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java Tue Aug 24 19:12:29 2010
@@ -110,7 +110,7 @@ public class WidgetImplementationProcess
         WidgetImplementation implementation = null;
 
         // Read the location attribute specifying the location of the resources
-        String location = reader.getAttributeValue(null, "location");
+        String location = getURIString(reader, "location");
         if (location != null) {
             implementation = implementationFactory.createWidgetImplementation();
             implementation.setLocation(location);

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryImplementationProcessor.java Tue Aug 24 19:12:29 2010
@@ -30,6 +30,7 @@ import org.apache.tuscany.sca.assembly.x
 import org.apache.tuscany.sca.contribution.Artifact;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+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;
@@ -47,7 +48,7 @@ import org.apache.tuscany.sca.monitor.im
  * Processor for the XQuery implementation type artifact
  * @version $Rev$ $Date$
  */
-public class XQueryImplementationProcessor implements StAXArtifactProcessor<XQueryImplementation> {
+public class XQueryImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<XQueryImplementation> {
 
     private static final String LOCATION = "location";
     private static final String IMPLEMENTATION_XQUERY = "implementation.xquery";
@@ -94,7 +95,7 @@ public class XQueryImplementationProcess
         XQueryImplementation xqueryImplementation = null;
 
         /* Read the location attribute for the XQuery implementation  */
-        String xqueryLocation = reader.getAttributeValue(null, LOCATION);
+        String xqueryLocation = getURIString(reader, LOCATION);
         if (xqueryLocation != null) {
         	xqueryImplementation = XQueryImplementationFactory.INSTANCE.createXQueryImplementation();
             xqueryImplementation.setLocation(xqueryLocation);

Modified: tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java?rev=988675&r1=988674&r2=988675&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6.1/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java Tue Aug 24 19:12:29 2010
@@ -32,6 +32,7 @@ import org.apache.tuscany.sca.assembly.E
 import org.apache.tuscany.sca.assembly.ExtensionFactory;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
@@ -57,7 +58,7 @@ import com.ibm.wsdl.OperationImpl;
  *
  * @version $Rev$ $Date$
  */
-public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterfaceContract>, WSDLConstants {
+public class WSDLInterfaceProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<WSDLInterfaceContract>, WSDLConstants {
 
     private WSDLFactory wsdlFactory;
     private ExtensionFactory extensionFactory;
@@ -152,14 +153,14 @@ public class WSDLInterfaceProcessor impl
         String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
         wsdlInterfaceContract.setLocation(location);
         
-        String uri = reader.getAttributeValue(null, INTERFACE);
+        String uri = getURIString(reader, INTERFACE);
         if (uri != null) {
             WSDLInterface wsdlInterface = createWSDLInterface(uri);
             if (wsdlInterface != null)
                 wsdlInterfaceContract.setInterface(wsdlInterface);
         }
         
-        uri = reader.getAttributeValue(null, CALLBACK_INTERFACE);
+        uri = getURIString(reader, CALLBACK_INTERFACE);
         if (uri != null) {
             WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri);
             if (wsdlCallbackInterface != null)



Mime
View raw message