ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r740910 - in /ode/branches/APACHE_ODE_1.X: bpel-dao/src/main/java/org/apache/ode/bpel/dao/ bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/ bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/ dao-hibernate/src/main/java/o...
Date Wed, 04 Feb 2009 22:01:35 GMT
Author: mriou
Date: Wed Feb  4 22:01:35 2009
New Revision: 740910

URL: http://svn.apache.org/viewvc?rev=740910&view=rev
Log:
Added a migration for the @2[...] multiple correlations scheme.

Added:
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java
Modified:
    ode/branches/APACHE_ODE_1.X/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageRouteDAO.java
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java
    ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/MessageRouteDaoImpl.java
    ode/branches/APACHE_ODE_1.X/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageRouteDaoImpl.java
    ode/branches/APACHE_ODE_1.X/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageRouteDAOImpl.java

Modified: ode/branches/APACHE_ODE_1.X/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageRouteDAO.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageRouteDAO.java?rev=740910&r1=740909&r2=740910&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageRouteDAO.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-dao/src/main/java/org/apache/ode/bpel/dao/MessageRouteDAO.java
Wed Feb  4 22:01:35 2009
@@ -48,6 +48,8 @@
      */
     public CorrelationKeySet getCorrelationKeySet();
 
+    void setCorrelationKeySet(CorrelationKeySet keySet);
+
     void setCorrelationKey(CorrelationKey key);
 
     CorrelationKey getCorrelationKey();

Added: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java?rev=740910&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java
(added)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java
Wed Feb  4 22:01:35 2009
@@ -0,0 +1,51 @@
+package org.apache.ode.bpel.engine.migration;
+
+import org.apache.ode.bpel.engine.BpelProcess;
+import org.apache.ode.bpel.dao.BpelDAOConnection;
+import org.apache.ode.bpel.dao.ProcessDAO;
+import org.apache.ode.bpel.dao.CorrelatorDAO;
+import org.apache.ode.bpel.dao.MessageRouteDAO;
+import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.common.CorrelationKey;
+import org.apache.ode.bpel.common.CorrelationKeySet;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.wsdl.Operation;
+import java.util.Set;
+import java.util.Iterator;
+
+/**
+ * Changes the scheme of the correlation key value in the routes to use @2[...]
+ */
+public class CorrelationKeySetDataMigration implements Migration {
+    private static final Log __log = LogFactory.getLog(CorrelationKeyMigration.class);
+
+    public boolean migrate(Set<BpelProcess> registeredProcesses, BpelDAOConnection
connection) {
+        for (BpelProcess process : registeredProcesses) {
+            __log.debug("Migrating correlators data for process " + process.getConf().getProcessId());
+            ProcessDAO processDao = connection.getProcess(process.getConf().getProcessId());
+
+            for (OPartnerLink plink : process.getOProcess().getAllPartnerLinks()) {
+                if (plink.hasMyRole()) {
+                    for (Iterator opI = plink.myRolePortType.getOperations().iterator();
opI.hasNext();) {
+                        Operation op = (Operation)opI.next();
+                        CorrelatorDAO corr = processDao.getCorrelator(plink.getName() + "."
+ op.getName());
+                        // Changing all routes
+                        if (corr != null) {
+                            for (MessageRouteDAO routeDAO : corr.getAllRoutes()) {
+                                CorrelationKey oldKey = routeDAO.getCorrelationKey();
+                                if (oldKey != null) {
+                                    CorrelationKeySet keySet = new CorrelationKeySet();
+                                    keySet.add(oldKey);
+                                    routeDAO.setCorrelationKeySet(keySet);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return true;
+    }
+}

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java?rev=740910&r1=740909&r2=740910&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java
Wed Feb  4 22:01:35 2009
@@ -17,13 +17,14 @@
 public class MigrationHandler {
     private static final Log __log = LogFactory.getLog(MigrationHandler.class);
 
-    public static final int CURRENT_SCHEMA_VERSION = 3;
+    public static final int CURRENT_SCHEMA_VERSION = 5;
 
     private Contexts _contexts;
     private List<MigrationLink> migrationLinks = new ArrayList<MigrationLink>()
{{
         add(new MigrationLink(1, 2, new Migration[] { new CorrelatorsMigration(), new CorrelationKeyMigration()
} ));
         add(new MigrationLink(2, 3, new Migration[] { new CorrelationKeySetMigration() }
));
         add(new MigrationLink(4, 3, new Migration[] { new CorrelationKeySetMigration() }
));
+        add(new MigrationLink(3, 5, new Migration[] { new CorrelationKeySetDataMigration()
} ));
     }};
 
 

Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/MessageRouteDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/MessageRouteDaoImpl.java?rev=740910&r1=740909&r2=740910&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/MessageRouteDaoImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/MessageRouteDaoImpl.java
Wed Feb  4 22:01:35 2009
@@ -70,4 +70,8 @@
     public CorrelationKey getCorrelationKey() {
         return _ckeySet.iterator().next();
     }
+
+    public void setCorrelationKeySet(CorrelationKeySet keySet) {
+        _ckeySet = keySet;
+    }
 }

Modified: ode/branches/APACHE_ODE_1.X/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageRouteDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageRouteDaoImpl.java?rev=740910&r1=740909&r2=740910&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageRouteDaoImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/MessageRouteDaoImpl.java
Wed Feb  4 22:01:35 2009
@@ -80,7 +80,11 @@
 		return new CorrelationKeySet(_selector.getCorrelationKey());
 	}
 
-     public void setCorrelationKey(CorrelationKey key) {
+    public void setCorrelationKeySet(CorrelationKeySet keySet) {
+        _selector.setCorrelationKey(keySet.toCanonicalString());
+    }
+
+    public void setCorrelationKey(CorrelationKey key) {
          _selector.setCorrelationKey(key.toCanonicalString());
      }
 

Modified: ode/branches/APACHE_ODE_1.X/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageRouteDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageRouteDAOImpl.java?rev=740910&r1=740909&r2=740910&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageRouteDAOImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/dao-jpa/src/main/java/org/apache/ode/dao/jpa/MessageRouteDAOImpl.java
Wed Feb  4 22:01:35 2009
@@ -112,4 +112,7 @@
 		return new CorrelationKeySet(_correlationKey);
 	}
 
+    public void setCorrelationKeySet(CorrelationKeySet keySet) {
+        _correlationKey = keySet.toCanonicalString();
+    }
 }



Mime
View raw message