[riftsaw-commits] riftsaw SVN: r946 - in trunk: distribution and 18 other directories.

riftsaw-commits at lists.jboss.org riftsaw-commits at lists.jboss.org
Tue Sep 14 20:36:51 EDT 2010


Author: jeff.yuchang
Date: 2010-09-14 20:36:49 -0400 (Tue, 14 Sep 2010)
New Revision: 946

Added:
   trunk/runtime/clustering/
   trunk/runtime/clustering/pom.xml
   trunk/runtime/clustering/src/
   trunk/runtime/clustering/src/main/
   trunk/runtime/clustering/src/main/java/
   trunk/runtime/clustering/src/main/java/org/
   trunk/runtime/clustering/src/main/java/org/jboss/
   trunk/runtime/clustering/src/main/java/org/jboss/soa/
   trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/
   trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/
   trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ClusteringException.java
   trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ClusteringService.java
   trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/JBossClusteringService.java
   trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ODEJobClusterListener.java
   trunk/runtime/clustering/src/main/resources/
   trunk/runtime/clustering/src/main/resources/META-INF/
   trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml
   trunk/runtime/clustering/src/test/
Removed:
   trunk/runtime/engine-assembly/src/main/resources/META-INF/jboss-beans.xml
Modified:
   trunk/distribution/pom.xml
   trunk/distribution/src/main/assembly/bin.xml
   trunk/distribution/src/main/release/db/jboss/jboss-beans.xml
   trunk/distribution/src/main/release/install/build.xml
   trunk/pom.xml
   trunk/qa/hudson-riftsaw-local.sh
   trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
   trunk/runtime/pom.xml
Log:
* RIFTSAW-197, using HAPartition service to detect nodes.
* only get deployed if the server_config is 'all'
* clustering module is clusterable, bpel engine doesn't know anything about it.
* still need to figure out how to get node name from jboss clustering.* still need to figure out how to get node name from jboss clustering.* still need to figure out how to get node name from jboss clustering.* still need to figure out how to get node name from jboss clustering.* still need to figure out how to get node name from jboss clustering.* still need to figure out how to get node name from jboss clustering.* still need to figure out how to get node name from jboss clustering.* still need to figure out how to get node name from jboss clustering.


Modified: trunk/distribution/pom.xml
===================================================================
--- trunk/distribution/pom.xml	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/distribution/pom.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -60,6 +60,10 @@
             <groupId>org.jboss.soa.bpel.runtime</groupId>
             <artifactId>riftsaw</artifactId>
             <type>zip</type>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.soa.bpel.runtime</groupId>
+            <artifactId>riftsaw-clustering</artifactId>
         </dependency>        
         <dependency>
             <groupId>org.jboss.soa.bpel</groupId>

Modified: trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- trunk/distribution/src/main/assembly/bin.xml	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/distribution/src/main/assembly/bin.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -127,6 +127,11 @@
       </includes>
     </fileSet>
 
+    <fileSet>
+      <directory>../runtime/clustering/src/main/resources/</directory>
+      <outputDirectory>/modules/clustering</outputDirectory>
+    </fileSet>
+
   </fileSets>
 
   <dependencySets>
@@ -181,6 +186,14 @@
       </includes>
     </dependencySet>
 
+    <!-- clustering module -->
+    <dependencySet>
+      <outputDirectory>/modules/clustering</outputDirectory>
+      <includes>
+        <include>org.jboss.soa.bpel.runtime:riftsaw-clustering</include>
+      </includes>
+    </dependencySet>   
+
   </dependencySets>
 
 </assembly>

Modified: trunk/distribution/src/main/release/db/jboss/jboss-beans.xml
===================================================================
--- trunk/distribution/src/main/release/db/jboss/jboss-beans.xml	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/distribution/src/main/release/db/jboss/jboss-beans.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -37,6 +37,8 @@
         class="org.jboss.soa.bpel.runtime.integration.ServerConfigImpl">
     <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
     <property name="webServiceHost">${jboss.bind.address}</property>
+    <property name="partitionName">${jboss.partition.name:DefaultPartition}</property>
+    <property name="serverName">${jboss.server.name}</property>
   </bean>
 
 

Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/distribution/src/main/release/install/build.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -32,6 +32,10 @@
   	</and>
   </condition>
 
+  <condition property="clustering.support">
+	   <equals arg1="${org_jboss_as_config}" arg2="all" />
+  </condition>
+
   <condition property="is.ws.stack.distro.available">
     <available file="${ws.stack.dir}/jbossws-${ws.stack}-${ws.version}.zip" />
   </condition>
@@ -74,7 +78,6 @@
   		<filterset>
   			<filter token="database" value="${database}"/>
   		</filterset>
-
   	</copy>
 
     <copy  file="../db/bpel.properties"
@@ -108,6 +111,8 @@
     <copy file="${modules}/bpel-console/gwt-console-rpc.jar" todir="${server.lib.dir}"/>
 
 	<antcall target="remove.redundant.juddi" />
+	
+	<antcall target="deploy-clustering" />
 
   </target>
 
@@ -210,6 +215,22 @@
     <mkdir dir="${ws.stack.dir}" />
     <get src="${ws.stack.distro.url}" dest="${ws.stack.dir}/jbossws-${ws.stack}-${ws.version}.zip" />
   </target>
+  
+  <!-- deploy clustering specific libraries and configurations-->
+  <target name="deploy-clustering" if="clustering.support">
+	<copy  file="../modules/clustering/META-INF/jboss-beans.xml"
+  		toFile="${deploy.dir}/${bpel-runtime}/META-INF/jboss-beans.xml" 
+  		overwrite="true">
+  		<filterset>
+  			<filter token="database" value="${database}"/>
+  		</filterset>
+  	</copy>
+    <copy todir="${deploy.dir}/${bpel-runtime}/lib" overwrite="true">
+      <fileset dir="../modules/clustering">
+        <include name="riftsaw-clustering-*.jar"/>
+      </fileset>
+    </copy>
+  </target>
 
   <target name="check.juddi">
     <condition property="is.juddi.duplicated">

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/pom.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -181,6 +181,16 @@
           <artifactId>riftsaw</artifactId>
           <version>${riftsaw.engine.version}</version>
           <type>zip</type>
+     </dependency>
+     <dependency>
+          <groupId>org.jboss.soa.bpel.runtime</groupId>
+          <artifactId>riftsaw-engine</artifactId>
+          <version>${riftsaw.engine.version}</version>
+     </dependency>
+     <dependency>
+          <groupId>org.jboss.soa.bpel.runtime</groupId>
+          <artifactId>riftsaw-clustering</artifactId>
+          <version>${riftsaw.engine.version}</version>
      </dependency>      
     <!-- ODE1.3.3 dependencies -->
     <dependency>
@@ -286,26 +296,26 @@
       <version>${commons.httpclient.version}</version>
     </dependency>
 
-    <dependency>
-      <groupId>net.sf.saxon</groupId>
-      <artifactId>saxon-dom</artifactId>
-      <version>${saxon.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>net.sf.saxon</groupId>
-      <artifactId>saxon-xpath</artifactId>
-      <version>${saxon.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>net.sf.saxon</groupId>
-      <artifactId>saxon-xqj</artifactId>
-      <version>${saxon.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>net.sf.saxon</groupId>
-      <artifactId>saxon</artifactId>
-      <version>${saxon.version}</version>
+    <dependency>
+      <groupId>net.sf.saxon</groupId>
+      <artifactId>saxon-dom</artifactId>
+      <version>${saxon.version}</version>
     </dependency>
+    <dependency>
+      <groupId>net.sf.saxon</groupId>
+      <artifactId>saxon-xpath</artifactId>
+      <version>${saxon.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>net.sf.saxon</groupId>
+      <artifactId>saxon-xqj</artifactId>
+      <version>${saxon.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>net.sf.saxon</groupId>
+      <artifactId>saxon</artifactId>
+      <version>${saxon.version}</version>
+    </dependency>
 
     </dependencies>
   </dependencyManagement>

Modified: trunk/qa/hudson-riftsaw-local.sh
===================================================================
--- trunk/qa/hudson-riftsaw-local.sh	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/qa/hudson-riftsaw-local.sh	2010-09-15 00:36:49 UTC (rev 946)
@@ -4,14 +4,14 @@
 
 MAVEN_OPTS="-Xms512M -Xmx1024M"
 
-RIFTSAW_PARENT_DIR="/local/deploy/riftsaw"
+RIFTSAW_PARENT_DIR="/Users/jeffyu/deploy/riftsaw"
 
 JBOSS_VERSION="5.1.0.GA"
-RIFTSAW_VERSION="2.1.0.CR2"
+RIFTSAW_VERSION="2.2.0-SNAPSHOT"
 AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
 AS_CONFIG="default"
 REPLACE_QA_JDBC="true"
-JBOSS_ESB_VERSION="4.7"
+JBOSS_ESB_VERSION="4.8"
 JBOSS_ESB_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jbossesb-$JBOSS_ESB_VERSION"
 DATABASE="hsql"
 
@@ -26,7 +26,7 @@
 
 # build RiftSaw and running unit test
 cd ..
-mvn clean install -Pdocs 
+mvn clean install 
 
 # run integration test
 cd qa

Added: trunk/runtime/clustering/pom.xml
===================================================================
--- trunk/runtime/clustering/pom.xml	                        (rev 0)
+++ trunk/runtime/clustering/pom.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.soa.bpel.runtime</groupId>
+  <artifactId>riftsaw-clustering</artifactId>
+  <packaging>jar</packaging>
+  <version>2.2.0-SNAPSHOT</version>
+  <name>RiftSaw::Runtime::Clustering</name>
+
+  <parent>
+    <groupId>org.jboss.soa.bpel</groupId>
+    <artifactId>runtime</artifactId>
+    <version>2.2.0-SNAPSHOT</version>
+  </parent>
+
+  <properties>
+  	<jboss.clustering.version>5.1.0.GA</jboss.clustering.version>
+  </properties>
+
+  <dependencies>
+	<dependency>
+		<groupId>org.jboss.jbossas</groupId>
+		<artifactId>jboss-as-cluster</artifactId>
+		<version>${jboss.clustering.version}</version>
+	</dependency>
+    <dependency>
+      <groupId>org.jboss.soa.bpel</groupId>
+      <artifactId>riftsaw-bpel-dao</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.soa.bpel.runtime</groupId>
+      <artifactId>riftsaw-engine</artifactId>
+    </dependency>    
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+					<excludes>
+						<exclude>**/jboss-beans.xml</exclude>
+					</excludes>
+				</configuration>
+			</plugin>
+        </plugins>
+    </build>
+
+</project>

Added: trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ClusteringException.java
===================================================================
--- trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ClusteringException.java	                        (rev 0)
+++ trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ClusteringException.java	2010-09-15 00:36:49 UTC (rev 946)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.soa.bpel.clustering;
+
+/**
+ * @author Jeff Yu
+ *
+ */
+public class ClusteringException extends RuntimeException {
+	
+	private static final long serialVersionUID = -8501640001948921543L;
+
+	public ClusteringException() {
+		super();
+	}
+
+	public ClusteringException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public ClusteringException(String message) {
+		super(message);
+	}
+
+	public ClusteringException(Throwable cause) {
+		super(cause);
+	}
+	
+	
+
+}

Added: trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ClusteringService.java
===================================================================
--- trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ClusteringService.java	                        (rev 0)
+++ trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ClusteringService.java	2010-09-15 00:36:49 UTC (rev 946)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.soa.bpel.clustering;
+
+/**
+ * 
+ * 
+ * @author Jeff Yu
+ *
+ */
+public interface ClusteringService {
+	
+	/**
+	 * 
+	 * @return the master nodeId from the clustering environment.
+	 */
+	public String getMasterNodeId();
+
+}

Added: trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/JBossClusteringService.java
===================================================================
--- trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/JBossClusteringService.java	                        (rev 0)
+++ trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/JBossClusteringService.java	2010-09-15 00:36:49 UTC (rev 946)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.soa.bpel.clustering;
+
+import java.util.Iterator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.ha.framework.interfaces.HAPartition;
+import org.jboss.soa.bpel.runtime.engine.ode.BPELEngineImpl;
+import org.jboss.util.naming.NonSerializableFactory;
+
+/**
+ * @author Jeff Yu
+ *
+ */
+public class JBossClusteringService implements ClusteringService{
+	
+	private static final Log logger = LogFactory.getLog(JBossClusteringService.class);
+	
+	private HAPartition haPartition;
+	
+	private String bpelEngineName; 
+	
+	private ODEJobClusterListener listener;
+	
+	private BPELEngineImpl engine;
+	
+	public void start() {
+		engine = getBpelEngine();
+		listener = new ODEJobClusterListener(engine.getSchedulerDAOConnectionFactory(), engine.getTransactionManager());
+		this.haPartition.registerMembershipListener(listener);
+		logger.debug("Registered ODEJobCluster Listener.");
+		
+/*		logger.info("==============CLUSTERING INFORMATION===================");
+		logger.info("NodeName =>" + haPartition.getNodeName());
+		logger.info("PartitionNode =>" + haPartition.getPartitionName());
+		logger.info("Cluster Node, name is " + haPartition.getClusterNode().getName() + 
+				" ip is: " + haPartition.getClusterNode().getIpAddress()
+				+ " port is: " + haPartition.getClusterNode().getPort());
+		
+		Iterator it = haPartition.getCurrentView().iterator();
+		while (it.hasNext()) {
+			Object o = it.next();
+			logger.info("view -> " + o );
+		}*/
+		
+	}
+	
+	public String getMasterNodeId() {
+		if (!haPartition.getCurrentView().isEmpty()) {
+			String nodeId = haPartition.getCurrentView().elementAt(0).toString();
+			logger.debug("The master node id is: " + nodeId);
+			return nodeId;
+		}
+		throw new ClusteringException("There are no nodes available in this clustering environment");
+	}
+	
+	public void stop() {
+		if (listener != null) {
+			this.haPartition.unregisterMembershipListener(listener);
+			logger.debug("Unregistered ODEJobCluster Listener.");
+		}
+	}
+	
+	
+	public HAPartition getHaPartition() {
+		return haPartition;
+	}
+
+	public void setHaPartition(HAPartition haPartition) {
+		this.haPartition = haPartition;
+	}
+
+	public String getBpelEngineName() {
+		return bpelEngineName;
+	}
+
+	public void setBpelEngineName(String bpelEngineName) {
+		this.bpelEngineName = bpelEngineName;
+	}
+	
+	public BPELEngineImpl getBpelEngine() {		
+		BPELEngineImpl engine = (BPELEngineImpl)NonSerializableFactory.lookup(this.bpelEngineName);		
+		return engine;
+	}
+
+
+}

Added: trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ODEJobClusterListener.java
===================================================================
--- trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ODEJobClusterListener.java	                        (rev 0)
+++ trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/clustering/ODEJobClusterListener.java	2010-09-15 00:36:49 UTC (rev 946)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.soa.bpel.clustering;
+
+import java.util.Iterator;
+import java.util.Vector;
+
+import javax.transaction.TransactionManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.dao.scheduler.DatabaseException;
+import org.apache.ode.dao.scheduler.SchedulerDAOConnection;
+import org.apache.ode.dao.scheduler.SchedulerDAOConnectionFactory;
+import org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener;
+
+/**
+ * 
+ * 
+ * @author Jeff Yu
+ *
+ */
+public class ODEJobClusterListener implements HAMembershipListener{
+	
+	private static Log logger = LogFactory.getLog(ODEJobClusterListener.class);
+	
+	private SchedulerDAOConnectionFactory schedulerCF;
+	
+	private TransactionManager txm;
+	
+	public ODEJobClusterListener(SchedulerDAOConnectionFactory scf, TransactionManager tmgr) {
+		this.schedulerCF = scf;
+		this.txm = tmgr;
+	}
+	
+	
+	/**
+	 * Move jobs that assoicated with dead members to an active node.
+	 * 
+	 */
+	public void membershipChanged(Vector deadMemebers, Vector newMembers, Vector allMemebers) {
+		if (allMemebers.isEmpty()) {
+			throw new ClusteringException("There are no active nodes in this clustering environment");
+		}
+		if (!deadMemebers.isEmpty()) {
+			SchedulerDAOConnection conn = schedulerCF.getConnection();
+			String activeNodeId = allMemebers.iterator().next().toString();
+			Iterator<?> it = deadMemebers.iterator();
+			try {
+				while (it.hasNext()) {
+					String deadNodeId = it.next().toString();
+					conn.updateReassign(deadNodeId, activeNodeId);
+					logger.debug("Move all of jobs associated with [" + deadNodeId + "] to new node [" + activeNodeId + "]");
+				}				
+			} catch (DatabaseException e) {
+				String errMsg = "Error in updating Job from dead node to active node : " + activeNodeId;
+				logger.error(errMsg);
+				throw new ClusteringException(errMsg, e);
+			}
+
+		}
+			
+		
+	}
+
+}

Added: trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean class="org.jboss.soa.bpel.runtime.db.DatabaseInitializer"
+        name="BPELDatabaseInitializer">
+    <property name="datasource"><value>java:/BPELDB</value></property>
+    <property name="existsSql"><value>select * from ODE_JOB</value></property>
+    <property name="sqlFiles"><value>bpel-sql/@database at .sql</value></property>
+    <property name="useEOL"><value>false</value></property>
+    <depends>jboss.jca:service=DataSourceBinding,name=BPELDB</depends>
+  </bean>
+
+  <bean class="org.jboss.soa.bpel.runtime.engine.service.BPELEngineService"
+        name="BPELEngine">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.bpel:service=BPELEngine", exposedInterface=org.jboss.soa.bpel.runtime.engine.service.BPELEngineServiceMBean.class,registerDirectly=true)</annotation>
+    <property name="jndiName"><value>bpel/Engine</value></property>
+    <property name="pmapiJndiName"><value>bpel/PMAPI</value></property>
+    <depends>jboss:service=Naming</depends>
+    <depends>BPELDatabaseInitializer</depends>
+    <depends>BPELDeployer</depends>
+  </bean>
+
+  <!--
+    Locate the single instance of the kernel
+    -->
+  <bean name="org.jboss.soa.bpel.runtime.util:service=KernelLocator"
+        class="org.jboss.soa.bpel.runtime.integration.KernelLocator">
+    <property name="kernel">
+      <inject bean="jboss.kernel:service=Kernel" />
+    </property>
+  </bean>
+
+  <!--
+       ServerConfig
+    -->
+  <bean name="org.jboss.soa.bpel.runtime.util:service=ServerConfig"
+        class="org.jboss.soa.bpel.runtime.integration.ServerConfigImpl">
+    <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+    <property name="webServiceHost">${jboss.bind.address}</property>
+    <property name="partitionName">${jboss.partition.name:DefaultPartition}</property>
+    <property name="serverName">${jboss.server.name}</property>
+  </bean>
+
+  
+  <!-- 
+  	JBoss Riftsaw Clustering service
+   -->
+   <bean name="RiftSawClusteringService" class="org.jboss.soa.bpel.clustering.JBossClusteringService">
+   	 <property name="haPartition"><inject bean="HAPartition" /></property>
+   	 <property name="bpelEngineName">bpel/Engine</property>
+   	 <depends>BPELEngine</depends>
+   </bean>
+
+</deployment>
\ No newline at end of file

Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java	2010-09-15 00:36:49 UTC (rev 946)
@@ -782,4 +782,13 @@
   public BpelServerImpl getBpelServer() {
 	  return _bpelServer;
   }
+  
+  public SchedulerDAOConnectionFactory getSchedulerDAOConnectionFactory() {
+	  return _schedulerDaoCF;
+  }
+  
+  public TransactionManager getTransactionManager() {
+	  return _txMgr;
+  }
+  
 }

Deleted: trunk/runtime/engine-assembly/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/runtime/engine-assembly/src/main/resources/META-INF/jboss-beans.xml	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/runtime/engine-assembly/src/main/resources/META-INF/jboss-beans.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-  <bean class="org.jboss.soa.bpel.runtime.db.DatabaseInitializer"
-        name="BPELDatabaseInitializer">
-    <property name="datasource"><value>java:/BPELDB</value></property>
-    <property name="existsSql"><value>select * from ODE_JOB</value></property>
-    <property name="sqlFiles"><value>bpel-sql/hsql.sql</value></property>
-    <property name="useEOL"><value>false</value></property>
-    <depends>jboss.jca:service=DataSourceBinding,name=BPELDB</depends>
-  </bean>
-
-  <bean class="org.jboss.soa.bpel.runtime.engine.service.BPELEngineService"
-        name="BPELEngine">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.bpel:service=BPELEngine", exposedInterface=org.jboss.soa.bpel.runtime.engine.service.BPELEngineServiceMBean.class,registerDirectly=true)</annotation>
-    <property name="jndiName"><value>bpel/Engine</value></property>
-    <property name="pmapiJndiName"><value>bpel/PMAPI</value></property>
-    <depends>jboss:service=Naming</depends>
-    <depends>BPELDatabaseInitializer</depends>
-    <depends>BPELDeployer</depends>
-  </bean>
-
-  <!--
-    Locate the single instance of the kernel
-    -->
-  <bean name="org.jboss.soa.bpel.runtime.util:service=KernelLocator"
-        class="org.jboss.soa.bpel.runtime.integration.KernelLocator">
-    <property name="kernel">
-      <inject bean="jboss.kernel:service=Kernel" />
-    </property>
-  </bean>
-
-  <!--
-       ServerConfig
-    -->
-  <bean name="org.jboss.soa.bpel.runtime.util:service=ServerConfig"
-        class="org.jboss.soa.bpel.runtime.integration.ServerConfigImpl">
-    <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
-    <property name="webServiceHost">${jboss.bind.address}</property>
-    <property name="partitionName">${jboss.partition.name:DefaultPartition}</property>
-    <property name="serverName">${jboss.server.name}</property>
-  </bean>
-
-
-</deployment>

Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml	2010-09-10 16:56:04 UTC (rev 945)
+++ trunk/runtime/pom.xml	2010-09-15 00:36:49 UTC (rev 946)
@@ -22,6 +22,7 @@
 	    <module>engine-assembly</module>
 		<module>jbossesb-bpel</module>
 		<module>jbossesb-bpel-assembly</module>
+                <module>clustering</module>
 		
 	</modules>
 



More information about the riftsaw-commits mailing list