You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ed...@apache.org on 2009/08/12 09:20:14 UTC

svn commit: r803391 - /tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java

Author: edwardsmj
Date: Wed Aug 12 07:20:13 2009
New Revision: 803391

URL: http://svn.apache.org/viewvc?rev=803391&view=rev
Log:
Remove support for ComponentType side files for BPEL Implementations, to bring the Tuscany code into compliance with the OASIS SCA BPEL C&I specification, as described in TUSCANY-3204

Modified:
    tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java

Modified: tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java?rev=803391&r1=803390&r2=803391&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java (original)
+++ tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImplementationProcessor.java Wed Aug 12 07:20:13 2009
@@ -137,9 +137,6 @@
             
                 // Get the component type from the process definition
                 generateComponentType( implementation );
-            
-                //resolve component type
-                mergeComponentType(resolver, implementation);
                         
                 //set current implementation resolved 
                 implementation.setUnresolved(false);
@@ -388,104 +385,6 @@
     } // end generateService
     
     /**
-     * TODO: Remove this function completely as the OASIS BPEL Implementation spec forbids
-     * the use of componentType side files and requires the componentType of a BPEL process to
-     * be found entirely via introspection.
-     * MJE 02 June 2009
-     * 
-     * Merge the componentType from introspection and from external file
-     * 
-     * Note the setting of the DataBinding for both Services and References to DOM, since this is
-     * the data format expected by the ODE BPEL implementation code.
-     * 
-     * @param resolver
-     * @param impl
-     */
-    private void mergeComponentType(ModelResolver resolver, BPELImplementation impl) {
-
-        // Load the component type from a component type file, if any
-        ComponentType componentType = getComponentType(resolver, impl);
-        if (componentType != null && !componentType.isUnresolved()) {
-
-            // References...
-            Map<String, Reference> refMap = new HashMap<String, Reference>();
-            for (Reference reference : componentType.getReferences()) {
-                refMap.put(reference.getName(), reference);
-            } // end for
-
-            // For the present, overwrite anything arising from the component
-            // type sidefile if
-            // equivalent services are defined in the implementation.
-            // TODO - a more careful merge must be done, using the
-            // implementation introspection data
-            // as the master but adding any additional and non-conflicting
-            // information from the
-            // sidefile
-            for (Reference ref : impl.getReferences()) {
-                refMap.put(ref.getName(), ref);
-            } // end for
-
-            impl.getReferences().clear();
-            impl.getReferences().addAll(refMap.values());
-
-            // Services.....
-            Map<String, Service> serviceMap = new HashMap<String, Service>();
-            for (Service service : componentType.getServices()) {
-                serviceMap.put(service.getName(), service);
-            } // end for
-
-            // For the present, overwrite anything arising from the component
-            // type sidefile if
-            // equivalent services are defined in the implementation.
-            // TODO - a more careful merge must be done, using the
-            // implementation introspection data
-            // as the master but adding any additional and non-conflicting
-            // information from the
-            // sidefile
-            for (Service svc : impl.getServices()) {
-                serviceMap.put(svc.getName(), svc);
-            } // end for
-
-            impl.getServices().clear();
-            impl.getServices().addAll(serviceMap.values());
-
-            // Properties
-            Map<String, Property> propMap = new HashMap<String, Property>();
-            for (Property property : componentType.getProperties()) {
-                propMap.put(property.getName(), property);
-            } // end for
-
-            // A simple overwrite of any equivalent properties from the
-            // component type sidefile
-            for (Property prop : impl.getProperties()) {
-                propMap.put(prop.getName(), prop);
-            }
-        }
-    }
-
-
-    /**
-     * Find the componentType side file based on the BPEL implementation artifact
-     * @param resolver
-     * @param impl
-     * @return
-     */
-    private ComponentType getComponentType(ModelResolver resolver, BPELImplementation impl) {
-        String bpelProcessURI = impl.getProcessDefinition().getURI().toString();
-        
-        // Get the component type definition contained in the componentType file, if any
-        String componentTypeURI = bpelProcessURI.replace(".bpel", ".componentType");
-        ComponentType componentType = assemblyFactory.createComponentType();
-        componentType.setUnresolved(true);
-        componentType.setURI(componentTypeURI);
-        componentType = resolver.resolveModel(ComponentType.class, componentType);
-        if (!componentType.isUnresolved()) {
-            return componentType;
-        }
-        return null;
-    } // end getComponentType
-
-    /**
      * Returns a QName from its string representation in a named attribute of an XML element
      * supplied in an XMLStreamReader
      *