You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2007/09/18 19:08:58 UTC

svn commit: r576978 - /ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java

Author: mriou
Date: Tue Sep 18 10:08:57 2007
New Revision: 576978

URL: http://svn.apache.org/viewvc?rev=576978&view=rev
Log:
ODE-183 Undeploying an older version doesn't remove the associated service for newer versions.

Modified:
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java

Modified: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java?rev=576978&r1=576977&r2=576978&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java Tue Sep 18 10:08:57 2007
@@ -193,13 +193,26 @@
                 Map.Entry<Endpoint,BpelProcess> processEntry = serviceIter.next();
                 if (processEntry.getValue()._pid.equals(process)) {
                     serviceIter.remove();
+                    System.out.println("### Removing PID " + process);
                     processEndpoint = processEntry.getKey();
                 }
             }
 
             // Only deactivating if no other process (version) need that endpoint anymore
-            if (_serviceMap.get(processEndpoint) == null)
+            // We're only routing using an endpoint/process map for now which means that deploying
+            // several versions of the same process using the same endpoint (which is the common
+            // case) will override previous deployments endpoints. So checking the endpoint is not
+            // enough, we also have to check other versions of the same process.
+            // A bit clunky, the maps held here should be retought a bit.
+            boolean otherVersions = false;
+            for (BpelProcess bpelProcess : _activeProcesses.values()) {
+                if (bpelProcess._pconf.getType().equals(p._pconf.getType()))
+                    otherVersions = true;
+            }
+            if (_serviceMap.get(processEndpoint) == null && !otherVersions) {
+                System.out.println("### Removing service for " + p._pid + " - " + otherVersions);
                 p.deactivate();
+            }
         }
         return p;
     }