You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2009/04/03 20:19:47 UTC

svn commit: r761748 - in /tuscany/branches/sca-java-2.0-M2: ./ features/webapp/ modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/ ...

Author: rfeng
Date: Fri Apr  3 18:19:46 2009
New Revision: 761748

URL: http://svn.apache.org/viewvc?rev=761748&view=rev
Log:
Merge changes from the trunk

Removed:
    tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java
Modified:
    tuscany/branches/sca-java-2.0-M2/features/webapp/pom.xml
    tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java
    tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
    tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java
    tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
    tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java
    tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java
    tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java
    tuscany/branches/sca-java-2.0-M2/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
    tuscany/branches/sca-java-2.0-M2/modules/host-jetty/META-INF/MANIFEST.MF
    tuscany/branches/sca-java-2.0-M2/modules/implementation-bpel/pom.xml
    tuscany/branches/sca-java-2.0-M2/modules/implementation-web-runtime/pom.xml
    tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java
    tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java
    tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java
    tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java
    tuscany/branches/sca-java-2.0-M2/pom.xml

Modified: tuscany/branches/sca-java-2.0-M2/features/webapp/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/features/webapp/pom.xml?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/features/webapp/pom.xml (original)
+++ tuscany/branches/sca-java-2.0-M2/features/webapp/pom.xml Fri Apr  3 18:19:46 2009
@@ -58,6 +58,12 @@
             <version>1.0.1</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-el_1.0_spec</artifactId>
+            <version>1.0.1</version>
+        </dependency>
+
     </dependencies>
 
 </project>

Modified: tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java Fri Apr  3 18:19:46 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.contribution.processor;
 
@@ -23,10 +23,10 @@
 
 /**
  * The default implementation of an artifact processor extension point.
- * 
+ *
  * @version $Rev$ $Date$
  */
-abstract class DefaultArtifactProcessorExtensionPoint<P> {
+abstract class DefaultArtifactProcessorExtensionPoint<P extends ArtifactProcessor<?>> {
     protected final Map<Object, P> processorsByArtifactType = new HashMap<Object, P>();
     protected final Map<Class<?>, P> processorsByModelType = new HashMap<Class<?>, P>();
 
@@ -38,7 +38,7 @@
 
     /**
      * Returns the processor associated with the given artifact type.
-     * 
+     *
      * @param artifactType An artifact type
      * @return The processor associated with the given artifact type
      */
@@ -48,11 +48,11 @@
 
     /**
      * Returns the processor associated with the given model type.
-     * 
+     *
      * @param modelType A model type
      * @return The processor associated with the given model type
      */
-    public P getProcessor(Class<?> modelType) {
+    public <T> P getProcessor(Class<T> modelType) {
         Class<?>[] classes = modelType.getInterfaces();
         for (Class<?> c : classes) {
             P processor = processorsByModelType.get(c);

Modified: tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java Fri Apr  3 18:19:46 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.contribution.processor;
 
@@ -43,11 +43,11 @@
 
 /**
  * The default implementation of an extension point for StAX artifact processors.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class DefaultStAXArtifactProcessorExtensionPoint extends
-    DefaultArtifactProcessorExtensionPoint<StAXArtifactProcessor> implements StAXArtifactProcessorExtensionPoint {
+    DefaultArtifactProcessorExtensionPoint<StAXArtifactProcessor<?>> implements StAXArtifactProcessorExtensionPoint {
 
     private ExtensionPointRegistry extensionPoints;
     private FactoryExtensionPoint modelFactories;
@@ -68,28 +68,37 @@
         UtilityExtensionPoint utilities = this.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
         MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
         if (monitorFactory != null)
-        	this.monitor = monitorFactory.createMonitor();
-        this.extensibleStAXProcessor = new ExtensibleStAXArtifactProcessor(this, inputFactory, outputFactory, this.monitor);
-        
-        StAXAttributeProcessorExtensionPoint attributeExtensionPoint = extensionPoints.getExtensionPoint(StAXAttributeProcessorExtensionPoint.class);
-        this.extensibleStAXAttributeProcessor = new ExtensibleStAXAttributeProcessor(attributeExtensionPoint ,inputFactory, outputFactory, this.monitor);
+            this.monitor = monitorFactory.createMonitor();
+        this.extensibleStAXProcessor =
+            new ExtensibleStAXArtifactProcessor(this, inputFactory, outputFactory, this.monitor);
+
+        StAXAttributeProcessorExtensionPoint attributeExtensionPoint =
+            extensionPoints.getExtensionPoint(StAXAttributeProcessorExtensionPoint.class);
+        this.extensibleStAXAttributeProcessor =
+            new ExtensibleStAXAttributeProcessor(attributeExtensionPoint, inputFactory, outputFactory, this.monitor);
     }
-    
+
     /**
      * Report a exception.
-     * 
+     *
      * @param problems
      * @param message
      * @param model
     */
     private void error(String message, Object model, Exception ex) {
         if (monitor != null) {
-    	    Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
-    	    monitor.problem(problem);
-    	}        
+            Problem problem =
+                monitor.createProblem(this.getClass().getName(),
+                                      "contribution-validation-messages",
+                                      Severity.ERROR,
+                                      model,
+                                      message,
+                                      ex);
+            monitor.problem(problem);
+        }
     }
 
-    public void addArtifactProcessor(StAXArtifactProcessor artifactProcessor) {
+    public void addArtifactProcessor(StAXArtifactProcessor<?> artifactProcessor) {
         if (artifactProcessor.getArtifactType() != null) {
             processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
         }
@@ -98,7 +107,7 @@
         }
     }
 
-    public void removeArtifactProcessor(StAXArtifactProcessor artifactProcessor) {
+    public void removeArtifactProcessor(StAXArtifactProcessor<?> artifactProcessor) {
         if (artifactProcessor.getArtifactType() != null) {
             processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
         }
@@ -108,13 +117,13 @@
     }
 
     @Override
-    public StAXArtifactProcessor getProcessor(Class<?> modelType) {
+    public <T> StAXArtifactProcessor<T> getProcessor(Class<T> modelType) {
         loadArtifactProcessors();
-        return super.getProcessor(modelType);
+        return (StAXArtifactProcessor<T>)super.getProcessor(modelType);
     }
 
     @Override
-    public StAXArtifactProcessor getProcessor(Object artifactType) {
+    public StAXArtifactProcessor<?> getProcessor(Object artifactType) {
         loadArtifactProcessors();
         return super.getProcessor(artifactType);
     }
@@ -122,7 +131,7 @@
     /**
      * Returns a QName object from a QName expressed as {ns}name
      * or ns#name.
-     * 
+     *
      * @param qname
      * @return
      */
@@ -142,7 +151,7 @@
                 return new QName(qname.substring(0, h), qname.substring(h + 1));
             }
         }
-        throw new IllegalArgumentException("Invalid qname: "+qname);
+        throw new IllegalArgumentException("Invalid qname: " + qname);
     }
 
     /**
@@ -155,10 +164,11 @@
         // Get the processor service declarations
         Set<ServiceDeclaration> processorDeclarations;
         try {
-            processorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(StAXArtifactProcessor.class.getName());
+            processorDeclarations =
+                ServiceDiscovery.getInstance().getServiceDeclarations(StAXArtifactProcessor.class.getName());
         } catch (IOException e) {
-        	IllegalStateException ie = new IllegalStateException(e);
-        	error("IllegalStateException", extensibleStAXProcessor, ie);
+            IllegalStateException ie = new IllegalStateException(e);
+            error("IllegalStateException", extensibleStAXProcessor, ie);
             throw ie;
         }
 
@@ -173,14 +183,14 @@
             // Get the model class name
             String modelTypeName = attributes.get("model");
 
-            // Get the model factory class name 
+            // Get the model factory class name
             String factoryName = attributes.get("factory");
 
             // Create a processor wrapper and register it
-            StAXArtifactProcessor processor =
-                new LazyStAXArtifactProcessor(artifactType, modelTypeName, factoryName,
-                                              processorDeclaration, extensionPoints, modelFactories, 
-                                              extensibleStAXProcessor,extensibleStAXAttributeProcessor, monitor);
+            StAXArtifactProcessor<?> processor =
+                new LazyStAXArtifactProcessor(artifactType, modelTypeName, factoryName, processorDeclaration,
+                                              extensionPoints, modelFactories, extensibleStAXProcessor,
+                                              extensibleStAXAttributeProcessor, monitor);
             addArtifactProcessor(processor);
         }
 
@@ -198,7 +208,7 @@
         private String modelTypeName;
         private String factoryName;
         private ServiceDeclaration processorDeclaration;
-        private StAXArtifactProcessor processor;
+        private StAXArtifactProcessor<?> processor;
         private Class<?> modelType;
         private StAXArtifactProcessor<Object> extensionProcessor;
         private StAXAttributeProcessor<Object> extensionAttributeProcessor;
@@ -227,12 +237,18 @@
         public QName getArtifactType() {
             return artifactType;
         }
-        
+
         private void error(String message, Object model, Exception ex) {
             if (monitor != null) {
-        	    Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
-        	    monitor.problem(problem);
-        	}        
+                Problem problem =
+                    monitor.createProblem(this.getClass().getName(),
+                                          "contribution-validation-messages",
+                                          Severity.ERROR,
+                                          model,
+                                          message,
+                                          ex);
+                monitor.problem(problem);
+            }
         }
 
         @SuppressWarnings("unchecked")
@@ -243,7 +259,8 @@
                     .equals("org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor")) {
 
                     // Specific initialization for the DefaultBeanModelProcessor
-                    FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+                    FactoryExtensionPoint modelFactories =
+                        extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
                     try {
                         Class<StAXArtifactProcessor> processorClass =
                             (Class<StAXArtifactProcessor>)processorDeclaration.loadClass();
@@ -261,84 +278,109 @@
                                                           Object.class,
                                                           Monitor.class);
                         processor =
-                            constructor.newInstance(modelFactories,
-                                                    artifactType,
-                                                    getModelType(),
-                                                    modelFactory,
-                                                    monitor);
+                            constructor
+                                .newInstance(modelFactories, artifactType, getModelType(), modelFactory, monitor);
                     } catch (Exception e) {
-                    	IllegalStateException ie = new IllegalStateException(e);
-                    	error("IllegalStateException", processor, ie);
+                        IllegalStateException ie = new IllegalStateException(e);
+                        error("IllegalStateException", processor, ie);
                         throw ie;
                     }
                 } else {
-                    FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+                    FactoryExtensionPoint modelFactories =
+                        extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
 
                     // Load and instantiate the processor class
                     try {
-                    	Class<StAXArtifactProcessor> processorClass =
-                    		(Class<StAXArtifactProcessor>)processorDeclaration.loadClass();
-                    	try {
-                    		Constructor<StAXArtifactProcessor> constructor =
-                    			processorClass.getConstructor(FactoryExtensionPoint.class, Monitor.class);
-                    		processor = constructor.newInstance(modelFactories, monitor);
-                    	} catch (NoSuchMethodException e) {
-                    		try {
-                    			Constructor<StAXArtifactProcessor> constructor =
-                    				processorClass.getConstructor(ExtensionPointRegistry.class, Monitor.class);
-                    			processor = constructor.newInstance(extensionPoints, monitor);
-                    		} catch (NoSuchMethodException e1) {
-                    			try {
-                    				Constructor<StAXArtifactProcessor> constructor =
-                    					processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class, Monitor.class);
-                    				processor = constructor.newInstance(modelFactories, extensionProcessor, monitor);
-                    			} catch (NoSuchMethodException e2) {
-                    				try {
-                    					Constructor<StAXArtifactProcessor> constructor =
-                    						processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class, StAXAttributeProcessor.class, Monitor.class);
-                    					processor = constructor.newInstance(modelFactories, extensionProcessor, extensionAttributeProcessor, monitor);
-                    				} catch (NoSuchMethodException e2a) {
-                    					try {
-                    						Constructor<StAXArtifactProcessor> constructor =
-                    							processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, Monitor.class);
-                    						processor = constructor.newInstance(extensionPoints, extensionProcessor, monitor);
-                    					} catch (NoSuchMethodException e3) {
-                    						try {
-                    							Constructor<StAXArtifactProcessor> constructor =
-                    								processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, StAXAttributeProcessor.class, Monitor.class);
-                    							processor = constructor.newInstance(extensionPoints, extensionProcessor, extensionAttributeProcessor, monitor);
-                    						} catch (NoSuchMethodException e3a) {
-
-                    							try {
-                    								Constructor<StAXArtifactProcessor> constructor =
-                    									processorClass.getConstructor(FactoryExtensionPoint.class);
-                    								processor = constructor.newInstance(modelFactories);
-                    							} catch (NoSuchMethodException e4) {
-                    								try {
-                    									Constructor<StAXArtifactProcessor> constructor =
-                    										processorClass.getConstructor(ExtensionPointRegistry.class);
-                    									processor = constructor.newInstance(extensionPoints);
-                    								} catch (NoSuchMethodException e4a) {
-                    									try {
-                    										Constructor<StAXArtifactProcessor> constructor =
-                    											processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class);
-                    										processor = constructor.newInstance(modelFactories, extensionProcessor);
-                    									} catch (NoSuchMethodException e5) {
-                    										Constructor<StAXArtifactProcessor> constructor =
-                    											processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class);
-                    										processor = constructor.newInstance(extensionPoints, extensionProcessor);
-                    									}
-                    								}
-                    							}
-                    						}
-                    					}
-                    				}
-                    			}
-                    		}
-                    	}
+                        Class<StAXArtifactProcessor> processorClass =
+                            (Class<StAXArtifactProcessor>)processorDeclaration.loadClass();
+                        try {
+                            Constructor<StAXArtifactProcessor> constructor =
+                                processorClass.getConstructor(FactoryExtensionPoint.class, Monitor.class);
+                            processor = constructor.newInstance(modelFactories, monitor);
+                        } catch (NoSuchMethodException e) {
+                            try {
+                                Constructor<StAXArtifactProcessor> constructor =
+                                    processorClass.getConstructor(ExtensionPointRegistry.class, Monitor.class);
+                                processor = constructor.newInstance(extensionPoints, monitor);
+                            } catch (NoSuchMethodException e1) {
+                                try {
+                                    Constructor<StAXArtifactProcessor> constructor =
+                                        processorClass.getConstructor(FactoryExtensionPoint.class,
+                                                                      StAXArtifactProcessor.class,
+                                                                      Monitor.class);
+                                    processor = constructor.newInstance(modelFactories, extensionProcessor, monitor);
+                                } catch (NoSuchMethodException e2) {
+                                    try {
+                                        Constructor<StAXArtifactProcessor> constructor =
+                                            processorClass.getConstructor(FactoryExtensionPoint.class,
+                                                                          StAXArtifactProcessor.class,
+                                                                          StAXAttributeProcessor.class,
+                                                                          Monitor.class);
+                                        processor =
+                                            constructor.newInstance(modelFactories,
+                                                                    extensionProcessor,
+                                                                    extensionAttributeProcessor,
+                                                                    monitor);
+                                    } catch (NoSuchMethodException e2a) {
+                                        try {
+                                            Constructor<StAXArtifactProcessor> constructor =
+                                                processorClass.getConstructor(ExtensionPointRegistry.class,
+                                                                              StAXArtifactProcessor.class,
+                                                                              Monitor.class);
+                                            processor =
+                                                constructor.newInstance(extensionPoints, extensionProcessor, monitor);
+                                        } catch (NoSuchMethodException e3) {
+                                            try {
+                                                Constructor<StAXArtifactProcessor> constructor =
+                                                    processorClass.getConstructor(ExtensionPointRegistry.class,
+                                                                                  StAXArtifactProcessor.class,
+                                                                                  StAXAttributeProcessor.class,
+                                                                                  Monitor.class);
+                                                processor =
+                                                    constructor.newInstance(extensionPoints,
+                                                                            extensionProcessor,
+                                                                            extensionAttributeProcessor,
+                                                                            monitor);
+                                            } catch (NoSuchMethodException e3a) {
+
+                                                try {
+                                                    Constructor<StAXArtifactProcessor> constructor =
+                                                        processorClass.getConstructor(FactoryExtensionPoint.class);
+                                                    processor = constructor.newInstance(modelFactories);
+                                                } catch (NoSuchMethodException e4) {
+                                                    try {
+                                                        Constructor<StAXArtifactProcessor> constructor =
+                                                            processorClass.getConstructor(ExtensionPointRegistry.class);
+                                                        processor = constructor.newInstance(extensionPoints);
+                                                    } catch (NoSuchMethodException e4a) {
+                                                        try {
+                                                            Constructor<StAXArtifactProcessor> constructor =
+                                                                processorClass
+                                                                    .getConstructor(FactoryExtensionPoint.class,
+                                                                                    StAXArtifactProcessor.class);
+                                                            processor =
+                                                                constructor.newInstance(modelFactories,
+                                                                                        extensionProcessor);
+                                                        } catch (NoSuchMethodException e5) {
+                                                            Constructor<StAXArtifactProcessor> constructor =
+                                                                processorClass
+                                                                    .getConstructor(ExtensionPointRegistry.class,
+                                                                                    StAXArtifactProcessor.class);
+                                                            processor =
+                                                                constructor.newInstance(extensionPoints,
+                                                                                        extensionProcessor);
+                                                        }
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
                     } catch (Exception e) {
-                    	IllegalStateException ie = new IllegalStateException(e);
-                    	error("IllegalStateException", processor, ie);
+                        IllegalStateException ie = new IllegalStateException(e);
+                        error("IllegalStateException", processor, ie);
                         throw ie;
                     }
                 }
@@ -361,8 +403,8 @@
                 try {
                     modelType = processorDeclaration.loadClass(modelTypeName);
                 } catch (Exception e) {
-                	IllegalStateException ie = new IllegalStateException(e);
-                	error("IllegalStateException", processorDeclaration, ie);
+                    IllegalStateException ie = new IllegalStateException(e);
+                    error("IllegalStateException", processorDeclaration, ie);
                     throw ie;
                 }
             }

Modified: tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXAttributeProcessorExtensionPoint.java Fri Apr  3 18:19:46 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.contribution.processor;
 
@@ -43,11 +43,11 @@
 
 /**
  * The default implementation of an extension point for StAX artifact processors.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class DefaultStAXAttributeProcessorExtensionPoint extends
-    DefaultArtifactProcessorExtensionPoint<StAXAttributeProcessor> implements StAXAttributeProcessorExtensionPoint {
+    DefaultArtifactProcessorExtensionPoint<StAXAttributeProcessor<?>> implements StAXAttributeProcessorExtensionPoint {
 
     private ExtensionPointRegistry extensionPoints;
     private FactoryExtensionPoint modelFactories;
@@ -66,26 +66,33 @@
         UtilityExtensionPoint utilities = this.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
         MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
         if (monitorFactory != null) {
-        	this.monitor = monitorFactory.createMonitor();
+            this.monitor = monitorFactory.createMonitor();
         }
-        this.extensibleStAXAttributeProcessor = new ExtensibleStAXAttributeProcessor(this, inputFactory, outputFactory, this.monitor);
+        this.extensibleStAXAttributeProcessor =
+            new ExtensibleStAXAttributeProcessor(this, inputFactory, outputFactory, this.monitor);
     }
-    
+
     /**
      * Report a exception.
-     * 
+     *
      * @param problems
      * @param message
      * @param model
     */
     private void error(String message, Object model, Exception ex) {
         if (monitor != null) {
-    	    Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
-    	    monitor.problem(problem);
-    	}        
+            Problem problem =
+                monitor.createProblem(this.getClass().getName(),
+                                      "contribution-validation-messages",
+                                      Severity.ERROR,
+                                      model,
+                                      message,
+                                      ex);
+            monitor.problem(problem);
+        }
     }
 
-    public void addArtifactProcessor(StAXAttributeProcessor artifactProcessor) {
+    public void addArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) {
         if (artifactProcessor.getArtifactType() != null) {
             processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor);
         }
@@ -94,7 +101,7 @@
         }
     }
 
-    public void removeArtifactProcessor(StAXAttributeProcessor artifactProcessor) {
+    public void removeArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor) {
         if (artifactProcessor.getArtifactType() != null) {
             processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType());
         }
@@ -104,13 +111,13 @@
     }
 
     @Override
-    public StAXAttributeProcessor getProcessor(Class<?> modelType) {
+    public <T> StAXAttributeProcessor<T> getProcessor(Class<T> modelType) {
         loadArtifactProcessors();
-        return super.getProcessor(modelType);
+        return (StAXAttributeProcessor<T>)super.getProcessor(modelType);
     }
 
     @Override
-    public StAXAttributeProcessor getProcessor(Object artifactType) {
+    public StAXAttributeProcessor<?> getProcessor(Object artifactType) {
         loadArtifactProcessors();
         return super.getProcessor(artifactType);
     }
@@ -118,7 +125,7 @@
     /**
      * Returns a QName object from a QName expressed as {ns}name
      * or ns#name.
-     * 
+     *
      * @param qname
      * @return
      */
@@ -138,7 +145,7 @@
                 return new QName(qname.substring(0, h), qname.substring(h + 1));
             }
         }
-        throw new IllegalArgumentException("Invalid qname: "+qname);
+        throw new IllegalArgumentException("Invalid qname: " + qname);
     }
 
     /**
@@ -151,10 +158,11 @@
         // Get the processor service declarations
         Set<ServiceDeclaration> processorDeclarations;
         try {
-            processorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(StAXAttributeProcessor.class.getName());
+            processorDeclarations =
+                ServiceDiscovery.getInstance().getServiceDeclarations(StAXAttributeProcessor.class.getName());
         } catch (IOException e) {
-        	IllegalStateException ie = new IllegalStateException(e);
-        	error("IllegalStateException", extensibleStAXAttributeProcessor, ie);
+            IllegalStateException ie = new IllegalStateException(e);
+            error("IllegalStateException", extensibleStAXAttributeProcessor, ie);
             throw ie;
         }
 
@@ -169,14 +177,14 @@
             // Get the model class name
             String modelTypeName = attributes.get("model");
 
-            // Get the model factory class name 
+            // Get the model factory class name
             String factoryName = attributes.get("factory");
 
             // Create a processor wrapper and register it
-            StAXAttributeProcessor processor =
-                new LazyStAXAttributeProcessor(artifactType, modelTypeName, factoryName,
-                                              processorDeclaration, extensionPoints, modelFactories, 
-                                              extensibleStAXAttributeProcessor, monitor);
+            StAXAttributeProcessor<?> processor =
+                new LazyStAXAttributeProcessor(artifactType, modelTypeName, factoryName, processorDeclaration,
+                                               extensionPoints, modelFactories, extensibleStAXAttributeProcessor,
+                                               monitor);
             addArtifactProcessor(processor);
         }
 
@@ -194,19 +202,19 @@
         private String modelTypeName;
         private String factoryName;
         private ServiceDeclaration processorDeclaration;
-        private StAXAttributeProcessor processor;
+        private StAXAttributeProcessor<?> processor;
         private Class<?> modelType;
         private StAXAttributeProcessor<Object> extensionProcessor;
         private Monitor monitor;
 
         LazyStAXAttributeProcessor(QName artifactType,
-                                  String modelTypeName,
-                                  String factoryName,
-                                  ServiceDeclaration processorDeclaration,
-                                  ExtensionPointRegistry extensionPoints,
-                                  FactoryExtensionPoint modelFactories,
-                                  StAXAttributeProcessor<Object> extensionProcessor,
-                                  Monitor monitor) {
+                                   String modelTypeName,
+                                   String factoryName,
+                                   ServiceDeclaration processorDeclaration,
+                                   ExtensionPointRegistry extensionPoints,
+                                   FactoryExtensionPoint modelFactories,
+                                   StAXAttributeProcessor<Object> extensionProcessor,
+                                   Monitor monitor) {
 
             this.extensionPoints = extensionPoints;
             this.artifactType = artifactType;
@@ -220,12 +228,18 @@
         public QName getArtifactType() {
             return artifactType;
         }
-        
+
         private void error(String message, Object model, Exception ex) {
             if (monitor != null) {
-        	    Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-validation-messages", Severity.ERROR, model, message, ex);
-        	    monitor.problem(problem);
-        	}        
+                Problem problem =
+                    monitor.createProblem(this.getClass().getName(),
+                                          "contribution-validation-messages",
+                                          Severity.ERROR,
+                                          model,
+                                          message,
+                                          ex);
+                monitor.problem(problem);
+            }
         }
 
         @SuppressWarnings("unchecked")
@@ -242,49 +256,56 @@
                             processorClass.getConstructor(FactoryExtensionPoint.class, Monitor.class);
                         processor = constructor.newInstance(modelFactories, monitor);
                     } catch (NoSuchMethodException e) {
-                      try {
-                          Constructor<StAXAttributeProcessor> constructor =
-                              processorClass.getConstructor(ExtensionPointRegistry.class, Monitor.class);
-                          processor = constructor.newInstance(extensionPoints, monitor);
-                      } catch (NoSuchMethodException e1) {
                         try {
                             Constructor<StAXAttributeProcessor> constructor =
-                                processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class, Monitor.class);
-                            processor = constructor.newInstance(modelFactories, extensionProcessor, monitor);
-                        } catch (NoSuchMethodException e2) {
+                                processorClass.getConstructor(ExtensionPointRegistry.class, Monitor.class);
+                            processor = constructor.newInstance(extensionPoints, monitor);
+                        } catch (NoSuchMethodException e1) {
                             try {
                                 Constructor<StAXAttributeProcessor> constructor =
-                                    processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class, Monitor.class);
-                                processor = constructor.newInstance(extensionPoints, extensionProcessor, monitor);
-                            } catch (NoSuchMethodException e3) {
+                                    processorClass.getConstructor(FactoryExtensionPoint.class,
+                                                                  StAXArtifactProcessor.class,
+                                                                  Monitor.class);
+                                processor = constructor.newInstance(modelFactories, extensionProcessor, monitor);
+                            } catch (NoSuchMethodException e2) {
                                 try {
                                     Constructor<StAXAttributeProcessor> constructor =
-                                        processorClass.getConstructor(FactoryExtensionPoint.class);
-                                    processor = constructor.newInstance(modelFactories);
-                                } catch (NoSuchMethodException e4) {
-                                  try {
-                                      Constructor<StAXAttributeProcessor> constructor =
-                                          processorClass.getConstructor(ExtensionPointRegistry.class);
-                                      processor = constructor.newInstance(extensionPoints);
-                                  } catch (NoSuchMethodException e4a) {
+                                        processorClass.getConstructor(ExtensionPointRegistry.class,
+                                                                      StAXArtifactProcessor.class,
+                                                                      Monitor.class);
+                                    processor = constructor.newInstance(extensionPoints, extensionProcessor, monitor);
+                                } catch (NoSuchMethodException e3) {
                                     try {
                                         Constructor<StAXAttributeProcessor> constructor =
-                                            processorClass.getConstructor(FactoryExtensionPoint.class, StAXArtifactProcessor.class);
-                                        processor = constructor.newInstance(modelFactories, extensionProcessor);
-                                    } catch (NoSuchMethodException e5) {
-                                        Constructor<StAXAttributeProcessor> constructor =
-                                            processorClass.getConstructor(ExtensionPointRegistry.class, StAXArtifactProcessor.class);
-                                        processor = constructor.newInstance(extensionPoints, extensionProcessor);
+                                            processorClass.getConstructor(FactoryExtensionPoint.class);
+                                        processor = constructor.newInstance(modelFactories);
+                                    } catch (NoSuchMethodException e4) {
+                                        try {
+                                            Constructor<StAXAttributeProcessor> constructor =
+                                                processorClass.getConstructor(ExtensionPointRegistry.class);
+                                            processor = constructor.newInstance(extensionPoints);
+                                        } catch (NoSuchMethodException e4a) {
+                                            try {
+                                                Constructor<StAXAttributeProcessor> constructor =
+                                                    processorClass.getConstructor(FactoryExtensionPoint.class,
+                                                                                  StAXArtifactProcessor.class);
+                                                processor = constructor.newInstance(modelFactories, extensionProcessor);
+                                            } catch (NoSuchMethodException e5) {
+                                                Constructor<StAXAttributeProcessor> constructor =
+                                                    processorClass.getConstructor(ExtensionPointRegistry.class,
+                                                                                  StAXArtifactProcessor.class);
+                                                processor =
+                                                    constructor.newInstance(extensionPoints, extensionProcessor);
+                                            }
+                                        }
                                     }
-                                  }
                                 }
                             }
                         }
-                      }
                     }
                 } catch (Exception e) {
-                	IllegalStateException ie = new IllegalStateException(e);
-                	error("IllegalStateException", processor, ie);
+                    IllegalStateException ie = new IllegalStateException(e);
+                    error("IllegalStateException", processor, ie);
                     throw ie;
                 }
 
@@ -292,12 +313,14 @@
             return processor;
         }
 
-        public Object read(QName attributeName, XMLStreamReader inputSource) throws ContributionReadException, XMLStreamException {
+        public Object read(QName attributeName, XMLStreamReader inputSource) throws ContributionReadException,
+            XMLStreamException {
             return getProcessor().read(attributeName, inputSource);
         }
 
         @SuppressWarnings("unchecked")
-        public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException, XMLStreamException {
+        public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException,
+            XMLStreamException {
             getProcessor().write(model, outputSource);
         }
 
@@ -306,8 +329,8 @@
                 try {
                     modelType = processorDeclaration.loadClass(modelTypeName);
                 } catch (Exception e) {
-                	IllegalStateException ie = new IllegalStateException(e);
-                	error("IllegalStateException", processorDeclaration, ie);
+                    IllegalStateException ie = new IllegalStateException(e);
+                    error("IllegalStateException", processorDeclaration, ie);
                     throw ie;
                 }
             }

Modified: tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java Fri Apr  3 18:19:46 2009
@@ -22,6 +22,10 @@
 import java.lang.reflect.Constructor;
 import java.net.URI;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.regex.Pattern;
@@ -46,7 +50,7 @@
  * @version $Rev$ $Date$
  */
 public class DefaultURLArtifactProcessorExtensionPoint extends
-    DefaultArtifactProcessorExtensionPoint<URLArtifactProcessor> implements URLArtifactProcessorExtensionPoint {
+    DefaultArtifactProcessorExtensionPoint<URLArtifactProcessor<?>> implements URLArtifactProcessorExtensionPoint {
 
     private ExtensionPointRegistry extensionPoints;
     private StAXArtifactProcessor<?> staxProcessor;
@@ -90,7 +94,7 @@
         }
     }
 
-    public void addArtifactProcessor(URLArtifactProcessor artifactProcessor) {
+    public void addArtifactProcessor(URLArtifactProcessor<?> artifactProcessor) {
         if (artifactProcessor.getArtifactType() != null) {
             Pattern pattern = Pattern.compile(wildcard2regex(artifactProcessor.getArtifactType()));
             processorsByArtifactType.put(pattern, artifactProcessor);
@@ -100,7 +104,7 @@
         }
     }
 
-    public void removeArtifactProcessor(URLArtifactProcessor artifactProcessor) {
+    public void removeArtifactProcessor(URLArtifactProcessor<?> artifactProcessor) {
         if (artifactProcessor.getArtifactType() != null) {
             String regex = wildcard2regex(artifactProcessor.getArtifactType());
             for (Object key : processorsByArtifactType.keySet()) {
@@ -116,38 +120,47 @@
     }
 
     @Override
-    public URLArtifactProcessor getProcessor(Class<?> modelType) {
+    public <T> URLArtifactProcessor<T> getProcessor(Class<T> modelType) {
         loadProcessors();
-        return super.getProcessor(modelType);
+        return (URLArtifactProcessor<T>)super.getProcessor(modelType);
     }
 
-    @Override
-    public URLArtifactProcessor getProcessor(Object artifactType) {
+    public Collection<URLArtifactProcessor<?>> getProcessors(Object artifactType) {
         loadProcessors();
-        URLArtifactProcessor processor = null;
         String uri = (String)artifactType;
         if (uri.endsWith("/")) {
             // Ignore directories
-            return null;
+            return Collections.emptyList();
         }
         if (!uri.startsWith("/")) {
             uri = "/" + uri;
         }
-        for (Object key : processorsByArtifactType.keySet()) {
-            Pattern pattern = (Pattern)key;
+        List<URLArtifactProcessor<?>> processors = new ArrayList<URLArtifactProcessor<?>>();
+        for (Map.Entry<Object, URLArtifactProcessor<?>> e : processorsByArtifactType.entrySet()) {
+            Pattern pattern = (Pattern)e.getKey();
             if (pattern.matcher(uri).matches()) {
-                return processorsByArtifactType.get(key);
+                processors.add(e.getValue());
             }
         }
-        return processor;
+        return processors;
+    }
+
+    public URLArtifactProcessor<?> getProcessor(Object artifactType) {
+        Collection<URLArtifactProcessor<?>> processors = getProcessors(artifactType);
+        return processors.isEmpty() ? null : processors.iterator().next();
     }
 
-    private String wildcard2regex(String wildcard) {
+    private static String wildcard2regex(String pattern) {
+        String wildcard = pattern;
+        if (wildcard.endsWith("/")) {
+            // Directory: xyz/ --> xyz/**
+            wildcard = wildcard + "**";
+        }
         if (wildcard.startsWith(".")) {
-            // File extension
+            // File extension: .xyz --> **/*.xyz
             wildcard = "**/*" + wildcard;
         } else if (wildcard.indexOf('/') == -1) {
-            // file name
+            // File name: abc.txt --> **/abc.txt
             wildcard = "**/" + wildcard;
         } else if (!(wildcard.startsWith("/") || wildcard.startsWith("**"))) {
             wildcard = '/' + wildcard;
@@ -158,9 +171,22 @@
             switch (chars[i]) {
                 case '*':
                     if (i < chars.length - 1 && chars[i + 1] == '*') {
-                        regex.append(".*");
-                        i++; // Skip next *
+                        // Next char is '*'
+                        if (i < chars.length - 2) {
+                            if (chars[i + 2] == '/') {
+                                // The wildcard is **/, it matches zero or more directories
+                                regex.append("(.*/)*");
+                                i += 2; // Skip */
+                            } else {
+                                // ** can only be followed by /
+                                throw new IllegalArgumentException("** can only be used as the name for a directory");
+                            }
+                        } else {
+                            regex.append(".*");
+                            i++; // Skip next *
+                        }
                     } else {
+                        // Non-directory
                         regex.append("[^/]*");
                     }
                     break;

Modified: tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java Fri Apr  3 18:19:46 2009
@@ -6,24 +6,51 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.contribution.processor;
 
 /**
  * An extension point for StAX artifact processors.
- * 
+ *
  * @version $Rev$ $Date$
  */
-public interface StAXArtifactProcessorExtensionPoint extends 
-    ArtifactProcessorExtensionPoint<StAXArtifactProcessor> {
+public interface StAXArtifactProcessorExtensionPoint {
+    /**
+     * Add an artifact processor.
+     *
+     * @param artifactProcessor The artifact processor to add
+     */
+    void addArtifactProcessor(StAXArtifactProcessor<?> artifactProcessor);
 
+    /**
+     * Remove an artifact processor.
+     *
+     * @param artifactProcessor The artifact processor to remove
+     */
+    void removeArtifactProcessor(StAXArtifactProcessor<?> artifactProcessor);
+
+    /**
+     * Returns the processor associated with the given artifact type.
+     *
+     * @param artifactType An artifact type
+     * @return The processor associated with the given artifact type
+     */
+    <T> StAXArtifactProcessor<T> getProcessor(Object artifactType);
+
+    /**
+     * Returns the processor associated with the given model type.
+     *
+     * @param modelType A model type
+     * @return The processor associated with the given model type
+     */
+    <T> StAXArtifactProcessor<T> getProcessor(Class<T> modelType);
 }

Modified: tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXAttributeProcessorExtensionPoint.java Fri Apr  3 18:19:46 2009
@@ -6,24 +6,51 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.contribution.processor;
 
 /**
  * An extension point for StAX artifact processors.
- * 
+ *
  * @version $Rev$ $Date$
  */
-public interface StAXAttributeProcessorExtensionPoint extends 
-    ArtifactProcessorExtensionPoint<StAXAttributeProcessor> {
+public interface StAXAttributeProcessorExtensionPoint {
+    /**
+     * Add an artifact processor.
+     *
+     * @param artifactProcessor The artifact processor to add
+     */
+    void addArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor);
 
+    /**
+     * Remove an artifact processor.
+     *
+     * @param artifactProcessor The artifact processor to remove
+     */
+    void removeArtifactProcessor(StAXAttributeProcessor<?> artifactProcessor);
+
+    /**
+     * Returns the processor associated with the given artifact type.
+     *
+     * @param artifactType An artifact type
+     * @return The processor associated with the given artifact type
+     */
+    <T> StAXAttributeProcessor<T> getProcessor(Object artifactType);
+
+    /**
+     * Returns the processor associated with the given model type.
+     *
+     * @param modelType A model type
+     * @return The processor associated with the given model type
+     */
+    <T> StAXAttributeProcessor<T> getProcessor(Class<T> modelType);
 }

Modified: tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java Fri Apr  3 18:19:46 2009
@@ -6,24 +6,60 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.contribution.processor;
 
+import java.util.Collection;
+
 /**
  * An extension point for URL artifact processors.
- * 
+ *
  * @version $Rev$ $Date$
  */
-public interface URLArtifactProcessorExtensionPoint extends
-    ArtifactProcessorExtensionPoint<URLArtifactProcessor> {
-    
+public interface URLArtifactProcessorExtensionPoint {
+    /**
+     * Add an artifact processor.
+     *
+     * @param artifactProcessor The artifact processor to add
+     */
+    void addArtifactProcessor(URLArtifactProcessor<?> artifactProcessor);
+
+    /**
+     * Remove an artifact processor.
+     *
+     * @param artifactProcessor The artifact processor to remove
+     */
+    void removeArtifactProcessor(URLArtifactProcessor<?> artifactProcessor);
+
+    /**
+     * Returns the processor associated with the given artifact type.
+     *
+     * @param artifactType An artifact type
+     * @return The processor associated with the given artifact type
+     */
+    <T> URLArtifactProcessor<T> getProcessor(Object artifactType);
+
+    /**
+     * Returns the processor associated with the given model type.
+     *
+     * @param modelType A model type
+     * @return The processor associated with the given model type
+     */
+    <T> URLArtifactProcessor<T> getProcessor(Class<T> modelType);
+
+    /**
+     * Return a collection of artifact processors that match the artifactType
+     * @param artifactType
+     * @return A collection of processors
+     */
+    Collection<URLArtifactProcessor<?>> getProcessors(Object artifactType);
 }

Modified: tuscany/branches/sca-java-2.0-M2/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java Fri Apr  3 18:19:46 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 
 package org.apache.tuscany.sca.extensibility.equinox;
@@ -118,7 +118,7 @@
         }
 
     }
-    
+
     /**
      * Empty static method to trigger the activation of this bundle.
      */
@@ -154,7 +154,7 @@
     /**
      * Parse a service declaration in the form class;attr=value,attr=value and
      * return a map of attributes
-     * 
+     *
      * @param declaration
      * @return a map of attributes
      */
@@ -185,7 +185,7 @@
         }
         return attributes;
     }
-    
+
     public ServiceDeclaration getFirstServiceDeclaration(String name) throws IOException {
         Set<ServiceDeclaration> declarations = getServiceDeclarations(name);
         if (declarations.isEmpty()) {
@@ -203,6 +203,7 @@
         boolean isPropertyFile = "javax.xml.xpath.XPathFactory".equals(serviceName);
         serviceName = "META-INF/services/" + serviceName;
 
+        Set<URL> visited = new HashSet<URL>();
         for (Bundle bundle : context.getBundles()) {
             if (bundle.getBundleId() == 0 || bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null) {
                 // Skip system bundle as it has access to the application classloader
@@ -214,7 +215,7 @@
                 // Use getResources to find resources on the classpath of the bundle
                 // Please note there are cases that getResources will return null even
                 // the bundle containing such entries:
-                // 1. There is a match on Import-Package or DynamicImport-Package, and another 
+                // 1. There is a match on Import-Package or DynamicImport-Package, and another
                 // bundle exports the resource package, there is a possiblity that it doesn't
                 // find the containing entry
                 // 2. The bundle cannot be resolved, then getResources will return null
@@ -240,6 +241,11 @@
             while (urls.hasMoreElements()) {
                 final URL url = urls.nextElement();
 
+                if (!visited.add(url)) {
+                    // The URL has already been processed
+                    continue;
+                }
+
                 if (debug) {
                     logger.fine("Reading service provider file: " + url.toExternalForm());
                 }

Modified: tuscany/branches/sca-java-2.0-M2/modules/host-jetty/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/host-jetty/META-INF/MANIFEST.MF?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/host-jetty/META-INF/MANIFEST.MF (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/host-jetty/META-INF/MANIFEST.MF Fri Apr  3 18:19:46 2009
@@ -16,15 +16,15 @@
  org.apache.tuscany.sca.core;version="2.0.0",
  org.apache.tuscany.sca.host.http;version="2.0.0",
  org.apache.tuscany.sca.work;version="2.0.0",
- org.mortbay.component;version="6.1.7",
- org.mortbay.jetty;version="6.1.7",
- org.mortbay.jetty.handler;version="6.1.7",
- org.mortbay.jetty.nio;version="6.1.7",
- org.mortbay.jetty.security;version="6.1.7",
- org.mortbay.jetty.servlet;version="6.1.7",
- org.mortbay.log;version="6.1.7",
- org.mortbay.resource;version="6.1.7",
- org.mortbay.thread;version="6.1.7"
+ org.mortbay.component;version="6.1.15",
+ org.mortbay.jetty;version="6.1.15",
+ org.mortbay.jetty.handler;version="6.1.15",
+ org.mortbay.jetty.nio;version="6.1.15",
+ org.mortbay.jetty.security;version="6.1.15",
+ org.mortbay.jetty.servlet;version="6.1.15",
+ org.mortbay.log;version="6.1.15",
+ org.mortbay.resource;version="6.1.15",
+ org.mortbay.thread;version="6.1.15"
 Bundle-SymbolicName: org.apache.tuscany.sca.host.jetty
 Bundle-DocURL: http://www.apache.org/
 

Modified: tuscany/branches/sca-java-2.0-M2/modules/implementation-bpel/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/implementation-bpel/pom.xml?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/implementation-bpel/pom.xml (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/implementation-bpel/pom.xml Fri Apr  3 18:19:46 2009
@@ -74,9 +74,9 @@
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
-			<version>3.8.1</version>
+			<version>4.5</version>
 			<scope>test</scope>
 		</dependency>
 	</dependencies>
-	
+
 </project>

Modified: tuscany/branches/sca-java-2.0-M2/modules/implementation-web-runtime/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/implementation-web-runtime/pom.xml?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/implementation-web-runtime/pom.xml (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/implementation-web-runtime/pom.xml Fri Apr  3 18:19:46 2009
@@ -69,15 +69,23 @@
             <scope>provided</scope>
         </dependency>
 
+        <!-- provided scope doesn't pull in transitive dependencies -->
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-el_1.0_spec</artifactId>
+            <version>1.0.1</version>
+            <scope>provided</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-sca-api</artifactId>
             <version>2.0-M2-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
-        
+
         <dependency>
-            <groupId>junit</groupId>                                      
+            <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.5</version>
             <scope>test</scope>

Modified: tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java Fri Apr  3 18:19:46 2009
@@ -6,19 +6,20 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.interfacedef;
 
 import java.util.List;
+import java.util.Map;
 
 import org.apache.tuscany.sca.policy.PolicySubject;
 
@@ -33,35 +34,35 @@
 
     /**
      * Returns true if the interface is a remotable interface..
-     * 
+     *
      * @return true if the interface is a remotable interface
      */
     boolean isRemotable();
 
     /**
      * Sets whether the interface is a remotable or local interface.
-     * 
+     *
      * @param remotable indicates whether the interface is remotable or local
      */
     void setRemotable(boolean remotable);
-    
-    
+
+
     // FIXME: [rfeng] We need to re-consider the conversational as an intent
     /**
      * Test if the interface is conversational
      * @return
      */
     boolean isConversational();
-    
+
     /**
-     * Set whether the interface is conversational 
+     * Set whether the interface is conversational
      * @param conversational
      */
     void setConversational(boolean conversational);
 
     /**
      * Returns the operations defined on this interface.
-     * 
+     *
      * @return the operations defined on this interface
      */
     List<Operation> getOperations();
@@ -73,7 +74,7 @@
      */
     @Deprecated
     void setDefaultDataBinding(String dataBinding);
-    
+
     /**
      * Reset the databinding for the interface
      * @param dataBinding
@@ -82,12 +83,18 @@
 
     /**
      * Returns true if the Interface is dynamic.
-     * 
+     *
      * @return true if the Interface is dynamic.
      */
     boolean isDynamic();
 
     /**
+     * Get a map of attributes assoicated with the interface
+     * @return A map of attributes
+     */
+    Map<Object, Object> getAttributes();
+
+    /**
      * Implementations must support cloning.
      */
     Object clone() throws CloneNotSupportedException;

Modified: tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java Fri Apr  3 18:19:46 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.interfacedef;
 
@@ -35,28 +35,28 @@
 public interface Operation extends Cloneable, PolicySubject {
     /**
      * Returns the name of the operation.
-     * 
+     *
      * @return the name of the operation
      */
     String getName();
 
     /**
      * Sets the name of the operation.
-     * 
+     *
      * @param name the name of the operation
      */
     void setName(String name);
 
     /**
      * Returns true if the model element is unresolved.
-     * 
+     *
      * @return true if the model element is unresolved.
      */
     boolean isUnresolved();
 
     /**
      * Sets whether the model element is unresolved.
-     * 
+     *
      * @param unresolved whether the model element is unresolved
      */
     void setUnresolved(boolean unresolved);
@@ -64,11 +64,11 @@
     /**
      * Get the data type that represents the input of this operation. The logic
      * type is a list of data types and each element represents a parameter
-     * 
+     *
      * @return the inputType
      */
     DataType<List<DataType>> getInputType();
-    
+
     /**
      * @param inputType
      */
@@ -76,11 +76,11 @@
 
     /**
      * Get the data type for the output
-     * 
+     *
      * @return the outputType
      */
     DataType getOutputType();
-    
+
     /**
      * @param outputType
      */
@@ -88,51 +88,51 @@
 
     /**
      * Get a list of data types to represent the faults/exceptions
-     * 
+     *
      * @return the faultTypes
      */
     List<DataType> getFaultTypes();
-    
+
     /**
      * @param faultTypes
      */
     void setFaultTypes(List<DataType> faultTypes);
-    
+
     /**
      * Get the owning interface
      * @return
      */
     Interface getInterface();
-    
+
     /**
      * Set the owning interface
      * @param interfaze
      */
     void setInterface(Interface interfaze);
-    
+
     /**
      * Get the sequence of the conversation
      * @return
      */
     ConversationSequence getConversationSequence();
-    
+
     /**
      * Set the sequence of conversation for the operation
      * @param sequence
      */
     void setConversationSequence(ConversationSequence sequence);
-    
+
     /**
      * Indicate if the operation is non-blocking
      * @return
      */
     boolean isNonBlocking();
-    
+
     /**
      * Set the operation to be non-blocking
      */
     void setNonBlocking(boolean nonBlocking);
-    
+
     /**
      * @return the wrapperInfo
      */
@@ -152,7 +152,7 @@
      * @param wrapperStyle the wrapperStyle to set
      */
     void setWrapperStyle(boolean wrapperStyle);
-    
+
     /**
      * @deprecated This should be the WrapperInfo.getDataBinding()
      * Get the databinding for the operation
@@ -160,7 +160,7 @@
      */
     @Deprecated
     String getDataBinding();
-    
+
     /**
      * @deprecated This should be the WrapperInfo.setDataBinding()
      * Set the databinding for the operation
@@ -168,10 +168,10 @@
      */
     @Deprecated
     void setDataBinding(String dataBinding);
-    
+
     /**
      * Returns true if the operation is dynamic.
-     * 
+     *
      * @return true if the operation is dynamic otherwise false
      */
     boolean isDynamic();
@@ -184,11 +184,11 @@
 
     /**
      * Get the synthesized fault beans for this operation
-     * 
+     *
      * @return the fault beans
      */
     Map<QName, List<DataType<XMLType>>> getFaultBeans();
-    
+
     /**
      * Set the synthesized fault beans for this operation
      * @param faultBeans
@@ -196,8 +196,14 @@
     void setFaultBeans(Map<QName, List<DataType<XMLType>>> faultBeans);
 
     /**
+     * Get a map of attributes assoicated with the operation
+     * @return A map of attributes
+     */
+    Map<Object, Object> getAttributes();
+
+    /**
      * Implementations must support cloning.
      */
     Object clone() throws CloneNotSupportedException;
-    
+
 }

Modified: tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java Fri Apr  3 18:19:46 2009
@@ -6,33 +6,35 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.interfacedef.impl;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.tuscany.sca.interfacedef.DataType;
 import org.apache.tuscany.sca.interfacedef.Interface;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
-import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.PolicySet;
 
 /**
  * Represents a service interface.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class InterfaceImpl implements Interface {
@@ -42,11 +44,10 @@
     private OperationList operations = new OperationList();
     private boolean unresolved;
 
-    private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
     private ExtensionType type;
     private List<PolicySet> policySets = new ArrayList<PolicySet>();
     private List<Intent> requiredIntents = new ArrayList<Intent>();
-
+    private Map<Object, Object> attributes = new ConcurrentHashMap<Object, Object>();
 
     public boolean isRemotable() {
         return remotable;
@@ -221,10 +222,6 @@
     public boolean isDynamic() {
         return false;
     }
-    
-    public List<PolicySet> getApplicablePolicySets() {
-        return applicablePolicySets;
-    }
 
     public List<PolicySet> getPolicySets() {
         return policySets;
@@ -250,6 +247,8 @@
             Operation clonedOperation = (Operation)operation.clone();
             copy.operations.add(clonedOperation);
         }
+        copy.attributes = new ConcurrentHashMap<Object, Object>();
+        copy.attributes.putAll(attributes);
         return copy;
     }
 
@@ -293,4 +292,8 @@
         return true;
     }
 
+    public Map<Object, Object> getAttributes() {
+        return attributes;
+    }
+
 }

Modified: tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java (original)
+++ tuscany/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java Fri Apr  3 18:19:46 2009
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.sca.interfacedef.impl;
 
@@ -22,6 +22,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.xml.namespace.QName;
 
@@ -31,13 +32,13 @@
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
 import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.PolicySet;
 
 /**
  * Represents an operation on a service interface.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class OperationImpl implements Operation {
@@ -53,8 +54,11 @@
     private boolean wrapperStyle;
     private WrapperInfo wrapper;
     private boolean dynamic;
+
+    private Map<Object, Object> attributes = new ConcurrentHashMap<Object, Object>();
+
     private Map<QName, List<DataType<XMLType>>> faultBeans;
-    
+
     private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
     private List<PolicySet> policySets = new ArrayList<PolicySet>();
     private List<Intent> requiredIntents = new ArrayList<Intent>();
@@ -280,11 +284,11 @@
     public void setDynamic(boolean b) {
         this.dynamic = b;
     }
-    
+
     public Map<QName, List<DataType<XMLType>>> getFaultBeans() {
         return faultBeans;
     }
-    
+
     public void setFaultBeans(Map<QName, List<DataType<XMLType>>> faultBeans) {
         this.faultBeans = faultBeans;
     }
@@ -292,7 +296,7 @@
     @Override
     public OperationImpl clone() throws CloneNotSupportedException {
         OperationImpl copy = (OperationImpl) super.clone();
-        
+
         final List<DataType> clonedFaultTypes = new ArrayList<DataType>(this.faultTypes.size());
         for (DataType t : this.faultTypes) {
             clonedFaultTypes.add((DataType) t.clone());
@@ -308,11 +312,14 @@
             new DataTypeImpl<List<DataType>>(inputType.getPhysical(), clonedLogicalTypes);
         clonedInputType.setDataBinding(inputType.getDataBinding());
         copy.inputType = clonedInputType;
-        
+
         if (this.outputType != null) {
             copy.outputType = (DataType) this.outputType.clone();
         }
-        
+
+        copy.attributes = new ConcurrentHashMap<Object, Object>();
+        copy.attributes.putAll(attributes);
+
         return copy;
     }
 
@@ -335,5 +342,9 @@
     public void setType(ExtensionType type) {
         this.type = type;
     }
-    
+
+    public Map<Object, Object> getAttributes() {
+        return attributes;
+    }
+
 }

Modified: tuscany/branches/sca-java-2.0-M2/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-2.0-M2/pom.xml?rev=761748&r1=761747&r2=761748&view=diff
==============================================================================
--- tuscany/branches/sca-java-2.0-M2/pom.xml (original)
+++ tuscany/branches/sca-java-2.0-M2/pom.xml Fri Apr  3 18:19:46 2009
@@ -274,7 +274,7 @@
                    <plugin> 
                        <groupId>org.apache.tuscany.maven.plugins</groupId> 
                        <artifactId>maven-bundle-plugin</artifactId> 
-                       <version>1.0.1</version> 
+                       <version>1.0.3-SNAPSHOT</version> 
                        <extensions>true</extensions> 
                     </plugin>
                     <plugin>
@@ -495,7 +495,7 @@
                         <dependency>
                             <groupId>org.apache.tuscany.maven.plugins</groupId>
                             <artifactId>maven-eclipse-compiler</artifactId>
-                            <version>1.0</version>
+                            <version>1.0.2-SNAPSHOT</version>
                             <scope>provided</scope>
                         </dependency>
                     </dependencies>