[riftsaw-commits] riftsaw SVN: r943 - in trunk/runtime: engine/src/main/java/org/jboss/soa/bpel/runtime/integration and 1 other directories.

riftsaw-commits at lists.jboss.org riftsaw-commits at lists.jboss.org
Fri Sep 10 09:31:37 EDT 2010


Author: objectiser
Date: 2010-09-10 09:31:36 -0400 (Fri, 10 Sep 2010)
New Revision: 943

Modified:
   trunk/runtime/engine-assembly/src/main/resources/META-INF/jboss-beans.xml
   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/integration/ServerConfig.java
   trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java
Log:
RIFTSAW-5 - set node name on scheduler based on the cluster partition and server name.

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 11:42:37 UTC (rev 942)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java	2010-09-10 13:31:36 UTC (rev 943)
@@ -41,9 +41,9 @@
 import org.apache.ode.utils.Properties;
 import org.jboss.soa.bpel.runtime.engine.BPELEngine;
 import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
+import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
 import org.w3c.dom.Element;
 
-import javax.sql.DataSource;
 import javax.transaction.*;
 import javax.transaction.xa.XAResource;
 import java.util.StringTokenizer;
@@ -466,7 +466,13 @@
   }
 
   protected Scheduler createScheduler() {
-    SimpleScheduler scheduler = new SimpleScheduler(new GUID().toString(), _schedulerDaoCF, _txMgr, _odeConfig.getProperties());
+	  
+	  String clusterNodeName=ServerConfigFactory.getServerConfig().getClusterNodeName();
+	  
+	  __log.info("Scheduler node name: "+clusterNodeName);
+	  
+	SimpleScheduler scheduler = new SimpleScheduler(clusterNodeName,
+							_schedulerDaoCF, _txMgr, _odeConfig.getProperties());
     scheduler.setExecutorService(_executorService);
     scheduler.setTransactionManager(_txMgr);
 

Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfig.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfig.java	2010-09-10 11:42:37 UTC (rev 942)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfig.java	2010-09-10 13:31:36 UTC (rev 943)
@@ -48,4 +48,10 @@
 
   int getWebServiceSecurePort();
 
+  public String getPartitionName();
+
+  public String getServerName();
+
+  public String getClusterNodeName();
+  
 }
\ No newline at end of file

Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java	2010-09-10 11:42:37 UTC (rev 942)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java	2010-09-10 13:31:36 UTC (rev 943)
@@ -23,6 +23,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.ode.utils.GUID;
 
 import javax.management.AttributeNotFoundException;
 import javax.management.JMException;
@@ -51,6 +52,10 @@
   private int webServicePort;
   // The webservice port that will be used when updating the wsdl
   private int webServiceSecurePort;
+  
+  private String partitionName="DefaultPartition";
+  private String serverName=null;
+  private static String nonClusteredServerName=new GUID().toString();
 
   public ServerConfigImpl()
   {
@@ -227,5 +232,31 @@
     }
   }
 
+  public String getPartitionName() {
+	  return(this.partitionName);
+  }
+  
+  public void setPartitionName(String name) {
+	  this.partitionName = name;
+  }
 
+  public String getServerName() {
+	  return(this.serverName);
+  }
+  
+  public void setServerName(String name) {
+	  this.serverName = name;
+  }
+  
+  public String getClusterNodeName() {
+	  String ret=this.serverName;
+	  
+	  // If server name not explicitly provided, then use a stable randomly generated name
+	  if (ret == null) {
+		  ret = ServerConfigImpl.nonClusteredServerName;
+	  }
+	  ret += ":"+this.partitionName;
+	  
+	  return(ret);
+  }
 }

Modified: 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 11:42:37 UTC (rev 942)
+++ trunk/runtime/engine-assembly/src/main/resources/META-INF/jboss-beans.xml	2010-09-10 13:31:36 UTC (rev 943)
@@ -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>
 
 



More information about the riftsaw-commits mailing list