[jboss-cvs] JBossAS SVN: r104899 - in trunk: component-matrix and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 17 22:17:50 EDT 2010


Author: pferraro
Date: 2010-05-17 22:17:49 -0400 (Mon, 17 May 2010)
New Revision: 104899

Added:
   trunk/tomcat/src/resources/mod_cluster/
   trunk/tomcat/src/resources/mod_cluster/mod_cluster-ha-jboss-beans.xml
   trunk/tomcat/src/resources/mod_cluster/mod_cluster-jboss-beans.xml
   trunk/tomcat/src/resources/mod_cluster/mod_cluster-local-jboss-beans.xml
Removed:
   trunk/tomcat/src/resources/mod_cluster-jboss-beans.xml
Modified:
   trunk/build/build.xml
   trunk/component-matrix/pom.xml
   trunk/testsuite/imports/config/tests-clustering.xml
   trunk/testsuite/imports/server-config.xml
   trunk/testsuite/src/main/org/jboss/test/cluster/mod_cluster/HAModClusterServiceTestCase.java
   trunk/testsuite/src/main/org/jboss/test/cluster/mod_cluster/ModClusterServiceTestCase.java
   trunk/tomcat/pom.xml
   trunk/tomcat/src/resources/jboss-beans.xml
   trunk/tomcat/src/resources/server.xml
Log:
[JBAS-8007] Upgrade mod_cluster to 1.1.0.CR2

Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/build/build.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -250,6 +250,11 @@
       <fileset dir="${project.root}/server/target/etc/conf/default"/>
     </copy>
 
+    <!-- Use clustered mod_cluster service in all -->
+  	<delete file="${install.all}/deploy/mod_cluster.sar/META-INF/mod_cluster-local-jboss-beans.xml"/>
+    <!-- Use non-clustered mod_cluster service in default -->
+  	<delete file="${install.default}/deploy/mod_cluster.sar/META-INF/mod_cluster-ha-jboss-beans.xml"/>
+
     <copy tofile="${install.default}/deployers/clustering-deployer-jboss-beans.xml"
           file="${project.root}/cluster/target/etc/clustering-deployer-jboss-beans-non-clustered.xml"/>
 

Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/component-matrix/pom.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -122,7 +122,7 @@
     <version.org.jboss.metadata.ejb>2.0.0-alpha-11</version.org.jboss.metadata.ejb>
     <version.org.jboss.metadata.rar>2.0.0.Alpha</version.org.jboss.metadata.rar>
     <version.org.jboss.metadata.war>2.0.0.Alpha14</version.org.jboss.metadata.war>
-    <version.org.jboss.mod_cluster>1.1.0.CR1</version.org.jboss.mod_cluster>
+    <version.org.jboss.mod_cluster>1.1.0.CR2</version.org.jboss.mod_cluster>
     <version.org.jboss.mx>6.0.0.Beta5</version.org.jboss.mx>
     <version.org.jboss.naming>5.0.5.Final</version.org.jboss.naming>
     <version.org.jboss.profileservice>0.1.0.Alpha1</version.org.jboss.profileservice>

Modified: trunk/testsuite/imports/config/tests-clustering.xml
===================================================================
--- trunk/testsuite/imports/config/tests-clustering.xml	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/testsuite/imports/config/tests-clustering.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -275,47 +275,41 @@
 
   <target name="tests-mod_cluster" depends="init">
 
-    <mkdir dir="${build.reports}"/>
-    <mkdir dir="${build.testlog}"/>
-    
-    <create-cluster-node conf="mod_cluster-0"/>
-    <create-cluster-node conf="mod_cluster-1"/>
-    
-    <server:start name="mod_cluster-0"/>
-    <server:start name="mod_cluster-1"/>
+    <create-profileservice-config conf="cluster-udp-0" baseconf="default"/>
+    <create-profileservice-config conf="cluster-udp-1" baseconf="default"/>
+  	
+    <server:start name="cluster-udp-0"/>
+    <server:start name="cluster-udp-1"/>
 
     <antcall target="tests-clustering-unit" inheritRefs="true">
       <param name="cluster.includes.refid" value="cluster.mod_cluster.includes"/>
-      <param name="jboss-junit-configuration" value="ModClusterService"/>
-      <param name="jbosstest.cluster.node0.config" value="mod_cluster-0"/>
-      <param name="jbosstest.cluster.node1.config" value="mod_cluster-1"/>
+      <param name="jboss-junit-configuration" value="Default-udp"/>
+      <param name="jbosstest.cluster.node0.config" value="cluster-udp-0"/>
+      <param name="jbosstest.cluster.node1.config" value="cluster-udp-1"/>
     </antcall>
 
-    <server:stop name="mod_cluster-0"/>
-    <server:stop name="mod_cluster-1"/>
+    <server:stop name="cluster-udp-0"/>
+    <server:stop name="cluster-udp-1"/>
 
   </target> 
 
   <target name="tests-ha-mod_cluster" depends="init">
 
-    <mkdir dir="${build.reports}"/>
-    <mkdir dir="${build.testlog}"/>
-    
-    <create-cluster-node conf="ha-mod_cluster-0"/>
-    <create-cluster-node conf="ha-mod_cluster-1"/>
-    
-    <server:start name="ha-mod_cluster-0"/>
-    <server:start name="ha-mod_cluster-1"/>
+    <create-cluster-node conf="cluster-udp-0"/>
+    <create-cluster-node conf="cluster-udp-1"/>
+  	
+    <server:start name="cluster-udp-0"/>
+    <server:start name="cluster-udp-1"/>
 
     <antcall target="tests-clustering-unit" inheritRefs="true">
       <param name="cluster.includes.refid" value="cluster.ha-mod_cluster.includes"/>
-      <param name="jboss-junit-configuration" value="HAModClusterService"/>
-      <param name="jbosstest.cluster.node0.config" value="ha-mod_cluster-0"/>
-      <param name="jbosstest.cluster.node1.config" value="ha-mod_cluster-1"/>
+      <param name="jboss-junit-configuration" value="Default-udp"/>
+      <param name="jbosstest.cluster.node0.config" value="cluster-udp-0"/>
+      <param name="jbosstest.cluster.node1.config" value="cluster-udp-1"/>
     </antcall>
 
-    <server:stop name="ha-mod_cluster-0"/>
-    <server:stop name="ha-mod_cluster-1"/>
+    <server:stop name="cluster-udp-0"/>
+    <server:stop name="cluster-udp-1"/>
 
   </target> 
 

Modified: trunk/testsuite/imports/server-config.xml
===================================================================
--- trunk/testsuite/imports/server-config.xml	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/testsuite/imports/server-config.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -769,50 +769,6 @@
          <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
          <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
-      
-      <server name="mod_cluster-0" host="${node0}">
-        <jvmarg value="-Xms128m" />
-        <jvmarg value="-Xmx512m" />
-        <jvmarg value="-XX:MaxPermSize=512m" />
-        <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
-        <sysproperty key="java.net.preferIPv4Stack" value="true" />
-        <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
-      </server>
-       
-      <server name="mod_cluster-1" host="${node1}">
-        <jvmarg value="-Xms128m" />
-        <jvmarg value="-Xmx512m" />
-        <jvmarg value="-XX:MaxPermSize=512m" />
-        <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
-        <sysproperty key="java.net.preferIPv4Stack" value="true" />
-        <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
-      </server>
-      
-      <server name="ha-mod_cluster-0" host="${node1}">
-        <jvmarg value="-Xms128m" />
-        <jvmarg value="-Xmx512m" />
-        <jvmarg value="-XX:MaxPermSize=512m" />
-        <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
-        <sysproperty key="java.net.preferIPv4Stack" value="true" />
-        <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
-      </server>
-       
-      <server name="ha-mod_cluster-1" host="${node0}">
-        <jvmarg value="-Xms128m" />
-        <jvmarg value="-Xmx512m" />
-        <jvmarg value="-XX:MaxPermSize=512m" />
-        <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
-        <sysproperty key="java.net.preferIPv4Stack" value="true" />
-        <sysproperty key="resolve.dns" value="false" />
-        <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
-        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
-      </server>
     	
       <server name="web-ondemand-disabled" host="${node0}">
          <jvmarg value="${jpda.cmdline}" />

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/mod_cluster/HAModClusterServiceTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/mod_cluster/HAModClusterServiceTestCase.java	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/mod_cluster/HAModClusterServiceTestCase.java	2010-05-18 02:17:49 UTC (rev 104899)
@@ -22,9 +22,11 @@
 package org.jboss.test.cluster.mod_cluster;
 
 import java.net.InetAddress;
+import java.nio.ByteBuffer;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
@@ -39,7 +41,8 @@
  */
 public class HAModClusterServiceTestCase extends JBossClusteredTestCase
 {
-   private static final String JVM_ROUTE_PATTERN = "%s:8009:jboss.web";
+   private static final String ENGINE = "jboss.web";
+   private static final int PORT = 8009;
    
    private MockProxy proxy = new MockProxy(2);
    
@@ -102,6 +105,7 @@
       }
       
       String[] hosts = this.getServers();
+      ByteBuffer buffer = ByteBuffer.allocate(InetAddress.getLocalHost().getAddress().length + (Integer.SIZE / Byte.SIZE) + ENGINE.getBytes().length);         
       
       for (int i = 0; i < hosts.length; ++i)
       {
@@ -109,8 +113,15 @@
          
          requests.clear();
 
-         count = this.proxy.getRequests(String.format(JVM_ROUTE_PATTERN, host)).drainTo(requests);
+         buffer.clear();
+         buffer.put(InetAddress.getByName(hosts[i]).getAddress());
+         buffer.putInt(PORT);
+         buffer.put(ENGINE.getBytes());
 
+         String jvmRoute = UUID.nameUUIDFromBytes(buffer.array()).toString();
+         
+         count = this.proxy.getRequests(jvmRoute).drainTo(requests);
+
          Assert.assertTrue(requests.toString(), count >= 2);
          
          Map.Entry<String, Map<String, String>> configRequest = requests.get(0);
@@ -120,10 +131,10 @@
          Assert.assertTrue(command, command.startsWith("CONFIG"));
          Assert.assertFalse(command.contains("*"));
          Assert.assertEquals(parameters.toString(), 6, parameters.size());
-         Assert.assertEquals("8009", parameters.get("Port"));
+         Assert.assertEquals(String.valueOf(PORT), parameters.get("Port"));
          Assert.assertEquals(host, parameters.get("Host"));
          Assert.assertEquals("ajp", parameters.get("Type"));
-         Assert.assertEquals(String.format(JVM_ROUTE_PATTERN, host), parameters.get("JVMRoute"));
+         Assert.assertEquals(jvmRoute, parameters.get("JVMRoute"));
          Assert.assertEquals("No", parameters.get("StickySessionForce"));
          Assert.assertEquals("1", parameters.get("Maxattempts"));
          
@@ -135,7 +146,7 @@
             Assert.assertTrue(command, command.startsWith("STATUS"));
             Assert.assertFalse(command.contains("*"));
             Assert.assertEquals(2, parameters.size());
-            Assert.assertEquals(String.format(JVM_ROUTE_PATTERN, host), parameters.get("JVMRoute"));
+            Assert.assertEquals(jvmRoute, parameters.get("JVMRoute"));
             String value = parameters.get("Load");
             Assert.assertNotNull(value);
             int load = Integer.parseInt(value);

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/mod_cluster/ModClusterServiceTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/mod_cluster/ModClusterServiceTestCase.java	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/mod_cluster/ModClusterServiceTestCase.java	2010-05-18 02:17:49 UTC (rev 104899)
@@ -22,9 +22,11 @@
 package org.jboss.test.cluster.mod_cluster;
 
 import java.net.InetAddress;
+import java.nio.ByteBuffer;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
@@ -40,7 +42,8 @@
  */
 public class ModClusterServiceTestCase extends JBossClusteredTestCase
 {
-   private static final String JVM_ROUTE_PATTERN = "%s:8009:jboss.web";
+   private static final String ENGINE = "jboss.web";
+   private static final int PORT = 8009;
    
    private MockProxy proxy = new MockProxy(2);
    
@@ -77,6 +80,7 @@
       ObjectName name = ObjectName.getInstance("jboss.web:service=ModCluster");
       
       String[] hosts = this.getServers();
+      ByteBuffer buffer = ByteBuffer.allocate(InetAddress.getLocalHost().getAddress().length + (Integer.SIZE / Byte.SIZE) + ENGINE.getBytes().length);         
       
       for (int i = 0; i < hosts.length; ++i)
       {
@@ -110,8 +114,15 @@
          
          requests.clear();
          
-         count = this.proxy.getRequests(String.format(JVM_ROUTE_PATTERN, host)).drainTo(requests);
+         buffer.clear();
+         buffer.put(InetAddress.getByName(hosts[i]).getAddress());
+         buffer.putInt(PORT);
+         buffer.put(ENGINE.getBytes());
+
+         String jvmRoute = UUID.nameUUIDFromBytes(buffer.array()).toString();
          
+         count = this.proxy.getRequests(jvmRoute).drainTo(requests);
+         
          Assert.assertTrue(Integer.toString(count), count >= 2);
          
          Map.Entry<String, Map<String, String>> configRequest = requests.get(0);
@@ -121,10 +132,10 @@
          Assert.assertTrue(command, command.startsWith("CONFIG"));
          Assert.assertFalse(command.contains("*"));
          Assert.assertEquals(parameters.toString(), 6, parameters.size());
-         Assert.assertEquals("8009", parameters.get("Port"));
+         Assert.assertEquals(String.valueOf(PORT), parameters.get("Port"));
          Assert.assertEquals(host, parameters.get("Host"));
          Assert.assertEquals("ajp", parameters.get("Type"));
-         Assert.assertEquals(String.format(JVM_ROUTE_PATTERN, host), parameters.get("JVMRoute"));
+         Assert.assertEquals(jvmRoute, parameters.get("JVMRoute"));
          Assert.assertEquals("No", parameters.get("StickySessionForce"));
          Assert.assertEquals("1", parameters.get("Maxattempts"));
          
@@ -136,7 +147,7 @@
             Assert.assertTrue(command, command.startsWith("STATUS"));
             Assert.assertFalse(command.contains("*"));
             Assert.assertEquals(2, parameters.size());
-            Assert.assertEquals(String.format(JVM_ROUTE_PATTERN, host), parameters.get("JVMRoute"));
+            Assert.assertEquals(jvmRoute, parameters.get("JVMRoute"));
             String value = parameters.get("Load");
             Assert.assertNotNull(value);
             int load = Integer.parseInt(value);

Modified: trunk/tomcat/pom.xml
===================================================================
--- trunk/tomcat/pom.xml	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/tomcat/pom.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -145,9 +145,9 @@
                 <mkdir dir="${output.deploy}/mod_cluster.sar/META-INF"/>
                 <copy file="${maven.dependency.org.jboss.mod_cluster.mod_cluster.jar.path}"
                       tofile="${output.deploy}/mod_cluster.sar/mod_cluster.jar"/>
-                <copy file="${output.resources}/mod_cluster-jboss-beans.xml"
-                      todir="${output.deploy}/mod_cluster.sar/META-INF"/>
-
+                <copy todir="${output.deploy}/mod_cluster.sar/META-INF">
+                   <fileset dir="${output.resources}/mod_cluster"/>
+                </copy>
              </tasks>
             </configuration>
           </execution>

Modified: trunk/tomcat/src/resources/jboss-beans.xml
===================================================================
--- trunk/tomcat/src/resources/jboss-beans.xml	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/tomcat/src/resources/jboss-beans.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -20,9 +20,6 @@
 
       <!-- Transaction manager for unfinished transaction checking in the CachedConnectionValve -->      
       <depends>jboss:service=TransactionManager</depends>
-
-      <!-- Uncomment to enable mod_cluster integration -->
-      <!--depends>ModClusterListener</depends-->
       
       <!-- 
          Do not configure other JMX attributes via this file.

Added: trunk/tomcat/src/resources/mod_cluster/mod_cluster-ha-jboss-beans.xml
===================================================================
--- trunk/tomcat/src/resources/mod_cluster/mod_cluster-ha-jboss-beans.xml	                        (rev 0)
+++ trunk/tomcat/src/resources/mod_cluster/mod_cluster-ha-jboss-beans.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Beans that provide JBoss AS-side functionality for mod_cluster. These
+  beans are all "On Demand", i.e. that are not installed unless requested.
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="ModClusterListener" class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter">
+    <constructor>
+      <!-- To use the local version of mod_cluster, change this injection to ModClusterService -->
+      <parameter class="org.jboss.modcluster.ContainerEventHandler"><inject bean="HAModClusterService"/></parameter>
+      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+    </constructor>
+    <depends>WebServer</depends>
+  </bean>
+
+</deployment>
\ No newline at end of file

Copied: trunk/tomcat/src/resources/mod_cluster/mod_cluster-jboss-beans.xml (from rev 104804, trunk/tomcat/src/resources/mod_cluster-jboss-beans.xml)
===================================================================
--- trunk/tomcat/src/resources/mod_cluster/mod_cluster-jboss-beans.xml	                        (rev 0)
+++ trunk/tomcat/src/resources/mod_cluster/mod_cluster-jboss-beans.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Beans that provide JBoss AS-side functionality for mod_cluster. These
+  beans are all "On Demand", i.e. that are not installed unless requested.
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+  
+  <!-- The core mod_cluster service -->
+  <bean name="ModClusterService" class="org.jboss.modcluster.ModClusterService" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
+    <constructor>
+      <parameter class="org.jboss.modcluster.config.ModClusterConfig"><inject bean="ModClusterConfig"/></parameter>
+      <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
+    </constructor>
+  </bean>
+  
+  <!-- The core mod_cluster service, implemented as an HA singleton -->
+  <!-- The HA partition allows mod_cluster to detect and handle crashed members -->
+  <bean name="HAModClusterService" class="org.jboss.modcluster.ha.HAModClusterService" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ha.HAModClusterServiceMBean.class)</annotation>
+    <constructor>
+      <parameter class="org.jboss.modcluster.config.ha.HAModClusterConfig"><inject bean="ModClusterConfig"/></parameter>
+      <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
+      <parameter class="org.jboss.ha.framework.interfaces.HAPartition"><inject bean="HAPartition"/></parameter>
+      <parameter class="org.jboss.ha.framework.interfaces.HASingletonElectionPolicy"><bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/></parameter>
+    </constructor>
+  </bean>
+
+  <!-- Configure this node's communication with the load balancer -->
+  <bean name="ModClusterConfig" class="org.jboss.modcluster.config.ha.HAModClusterConfig" mode="On Demand">
+    
+    <!-- Comma separated list of address:port listing the httpd servers
+         where mod_cluster is running. -->
+    <property name="proxyList">${jboss.mod_cluster.proxyList:}</property>
+    
+    <!-- URL prefix to send with commands to mod_cluster.  Default is no prefix. -->
+    <!--property name="proxyURL"></property-->
+    
+    <!-- mod_advertise is a small httpd module that advertises the 
+         availability of httpd servers via multicast, allowing 
+         ModClusterService to discover the httpd front-end instead of/in 
+         addition to having them defined in proxyList. -->
+    <!-- Whether to listen for advertise messages -->
+    <property name="advertise">${jboss.mod_cluster.advertise.enabled:false}</property>
+    
+    <!-- Multicast address on which to listen for advertisements -->
+    <property name="advertiseGroupAddress">
+      <value-factory bean="ServiceBindingManager" method="getStringBinding">
+        <parameter>ModClusterService</parameter>
+        <parameter>AdvertiseGroup</parameter>
+        <parameter><null/></parameter>
+      </value-factory>
+    </property>
+    <!-- Port on which to listen for advertisements -->
+    <property name="advertisePort">
+      <value-factory bean="ServiceBindingManager" method="getIntBinding">
+        <parameter>ModClusterService</parameter>
+        <parameter>AdvertiseGroup</parameter>
+      </value-factory>
+    </property>
+    <!-- Network interface address on which to listen for advertisements -->
+    <property name="advertiseInterface">
+      <value-factory bean="ServiceBindingManager" method="getStringBinding">
+        <parameter>ModClusterService</parameter>
+        <parameter>AdvertiseGroupInterface</parameter>
+        <parameter><null/></parameter>
+      </value-factory>
+    </property>
+    
+    <!-- Override the java.util.concurrent.ThreadFactory used by the advertise listener -->
+    <!--property name="advertiseThreadFactory"></property-->
+    
+    <!-- Comma delimited list of contexts that should *not* be auto-registered with httpd. -->
+    <!-- ROOT indicates the root context. -->
+    <!-- Context may be qualified by host using a colon, e.g. host1:context1 -->
+    <!-- If no host is defined, localhost is assumed. -->
+    <property name="excludedContexts">${jboss.mod_cluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console}</property>
+    <!-- If disabled, contexts will *not* auto-enable during startup/deploy, and instead be enabled manually -->
+    <property name="autoEnableContexts">${jboss.mod_cluster.autoEnableContexts:true}</property>
+    
+    <!-- Security key the proxy is going to send with advertise messages. 
+         Default is none. -->
+    <!--property name="advertiseSecurityKey"></property-->
+    
+    <!-- Whether to use SSL to communicate with mod_cluster. Note this
+         has nothing to do with handling of https requests by JBoss Web -->
+    <property name="ssl">false</property>
+    
+    <!-- Use domains to group nodes into fail-over groups -->
+    <!-- Requests stuck to a node that is no longer available with fail over to a node within the same domain, if possible -->
+    <!-- Typically used in concert with sticky sessions and buddy replication -->
+    <!--property name="domain"></property-->
+    
+    <!-- Should we use an HA singleton per domain? -->
+    <!--property name="masterPerDomain"></property-->
+    
+    <!-- Configuration values for the load balancer itself (must be the
+         same on all nodes in the cluster). These will be passed to the 
+         load balancer. -->
+    <property name="stickySession">true</property>
+    <property name="stickySessionForce">false</property>
+    <property name="stickySessionRemove">false</property>
+    <property name="maxAttempts">1</property>
+    <property name="workerTimeout">-1</property>
+  </bean>
+  
+  <!-- Provides information to ModClusterService informing it how much load 
+       this server should take.  This impl calculates the load factor from a 
+       number of metrics and adjusts the value periodically based on runtime
+       conditions, using the JBossWeb engine's backgroundProcessorDelay. -->
+  <bean name="DynamicLoadBalanceFactorProvider" class="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProviderMBean.class)</annotation>
+    <constructor>
+      <parameter>
+        <!-- Define the load metrics to use in your load balance factor calculation here -->
+        <set elementClass="org.jboss.modcluster.load.metric.LoadMetric">
+          <inject bean="AverageSystemLoadMetric"/>
+          <inject bean="BusyConnectorsLoadMetric"/>
+        </set>
+      </parameter>
+    </constructor>
+    <!-- The number of historical load values used to determine load factor -->
+    <!--property name="history">9</property-->
+    <!-- The exponential decay factor for historical load values -->
+    <!--property name="decayFactor">2</property-->
+  </bean>
+
+  <!-- Default load metrics/sources -->
+
+  <!-- CPU usage -->
+  <!-- Perhaps the best metric for determining system load - but only available on Java 1.6 or later -->
+  <bean name="AverageSystemLoadMetric" class="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=AverageSystemLoad",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter><inject bean="OperatingSystemLoadMetricSource"/></parameter>
+    </constructor>
+    <!-- The weight determines the significance of this metric with respect
+         to others in the overall load balance factor calculation -->
+    <property name="weight">2</property>
+  </bean>
+  <!-- Uses the platform's OperatingSystemMXBean -->
+  <bean name="OperatingSystemLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource" mode="On Demand"></bean>
+
+  <!-- The JBossWeb connector thread pool usage as a ratio of busy threads to max thread pool size -->
+  <!-- Analogous to method=B in mod_jk -->
+  <bean name="BusyConnectorsLoadMetric" class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=BusyConnectors",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter><inject bean="ThreadPoolLoadMetricSource"/></parameter>
+    </constructor>
+    <property name="weight">1</property>
+  </bean>
+  <!-- Queries all JBossWeb ThreadPool mbeans -->
+  <bean name="ThreadPoolLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.ThreadPoolLoadMetricSource" mode="On Demand">
+    <constructor>
+      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+      <!-- Object name pattern for connector thread pools -->
+      <!--parameter>jboss.web:type=ThreadPool,*</parameter-->
+    </constructor>
+  </bean>
+
+
+  <!-- Alternative load balance factor providers -->
+  
+  <!-- Basic impl that returns a static load balance factor.
+       This would replace the DynamicLoadBalanceFactorProvider
+       used above.
+   -->
+  <bean name="SimpleLoadBalanceFactorProvider" class="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProviderMBean.class)</annotation>
+    <property name="loadBalanceFactor">1</property>
+  </bean>
+
+  <!-- 
+       Alternative load metrics, grouped by source. 
+       To use these, inject them into the set passed to the
+       DynamicLoadBalanceFactorProvider bean's constructor above.
+   -->
+  
+  <!-- The system memory usage as ratio of used memory to total memory size -->
+  <!-- Requires com.sun.management.OperatingSystemMXBean -->
+  <bean name="SystemMemoryUsageLoadMetric" class="org.jboss.modcluster.load.metric.impl.SystemMemoryUsageLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SystemMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter><inject bean="OperatingSystemLoadMetricSource"/></parameter>
+    </constructor>
+  </bean>
+
+  
+  <!-- The heap memory usage as a ratio of used heap to max heap size -->
+  <!-- N.B. This load metric is its own source -->
+  <bean name="HeapMemoryUsageLoadMetric" class="org.jboss.modcluster.load.metric.impl.HeapMemoryUsageLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=HeapMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+  </bean>
+
+
+  <!-- The number of requests/sec processed by the JBossWeb connectors, with respect to the defined capacity -->
+  <!-- Analogous to method=R in mod_jk -->
+  <bean name="RequestCountLoadMetric" class="org.jboss.modcluster.load.metric.impl.RequestCountLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=RequestCount",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
+      <!--parameter>requestCount</parameter-->
+    </constructor>
+    <!-- This metric requires an explicit capacity, e.g. maximum capacity of 1000 requests/sec -->
+    <property name="capacity">1000</property>
+  </bean>
+  <!-- The incoming traffic received by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
+  <!-- Analogous to method=T in mod_jk -->
+  <bean name="ReceiveTrafficLoadMetric" class="org.jboss.modcluster.load.metric.impl.ReceiveTrafficLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ReceiveTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
+      <!--parameter>bytesReceived</parameter-->
+    </constructor>
+    <!-- This metric requires an explicit capacity, e.g. max capacity of 1024 KB/s -->
+    <property name="capacity">1024</property>
+  </bean>
+  <!-- The outgoing traffic sent by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
+  <bean name="SendTrafficLoadMetric" class="org.jboss.modcluster.load.metric.impl.SendTrafficLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SendTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
+      <!--parameter>bytesSent</parameter-->
+    </constructor>
+    <!-- This metric requires an explicit capacity, e.g. max capacity of 512 KB/s -->
+    <property name="capacity">512</property>
+  </bean>
+  <!-- Queries all JBossWeb GlobalRequestProcessor mbeans -->
+  <bean name="RequestProcessorLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource" mode="On Demand">
+    <constructor>
+      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+      <!-- Object name pattern for request processors -->
+      <!--parameter>jboss.web:type=GlobalRequestProcessor,*</parameter-->
+    </constructor>
+  </bean>
+
+
+  <!-- The number of active sessions, with respect to the defined capacity -->
+  <!-- Analogous to method=S in mod_jk -->
+  <bean name="ActiveSessionsLoadMetric" class="org.jboss.modcluster.load.metric.impl.ActiveSessionsLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ActiveSessions",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter><inject bean="SessionLoadMetricSource"/></parameter>
+      <!--parameter>activeSessions</parameter-->
+    </constructor>
+    <!-- This metric requires an explicit capacity, e.g. max capacity of 1000 active sessions -->
+    <property name="capacity">1000</property>
+  </bean>
+  <!-- Queries all JBossWeb session manager mbeans -->
+  <bean name="SessionLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.SessionLoadMetricSource" mode="On Demand">
+    <constructor>
+      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+      <!-- Object name pattern for session managers -->
+      <!--parameter>jboss.web:type=Manager,*</parameter-->
+    </constructor>
+  </bean>
+
+  
+  <!-- Returns the connection pool usage as a ratio of used to max pool size -->
+  <bean name="ConnectionPoolUsageMetric" class="org.jboss.modcluster.load.metric.impl.ConnectionPoolUsageLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ConnectionPoolUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter><inject bean="ConnectionPoolLoadMetricSource"/></parameter>
+      <!--parameter>InUseConnectionCount</parameter-->
+      <!--parameter>MaxSize</parameter-->
+    </constructor>
+  </bean>
+  <!-- Queries all JCA connection pools -->
+  <bean name="ConnectionPoolLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.ConnectionPoolLoadMetricSource" mode="On Demand">
+    <constructor>
+      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+      <!-- Object name pattern for connector thread pools -->
+      <!--parameter>jboss.jca:service=ManagedConnectionPool,*</parameter-->
+    </constructor>
+  </bean>
+
+  <!-- Generic load metrics/sources -->
+  
+  <!-- Uses the sum of the values of the specified attribute for each
+       mbean matching the query, with respect to a defined capacity. -->
+  <bean name="MBeanAttributeLoadMetric" class="org.jboss.modcluster.load.metric.impl.MBeanAttributeLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttribute",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter><inject bean="MBeanQueryLoadMetricSource"/></parameter>
+      <parameter><!-- mbean attribute --></parameter>
+    </constructor>
+    <property name="capacity">1</property>
+  </bean>
+  <!-- Uses the ratio of the sum of the values of the specified dividend attribute,
+       to the sum of the values of the specified divisor attribute for each mbean
+       matching the query. -->
+  <bean name="MBeanAttributeRatioLoadMetric" class="org.jboss.modcluster.load.metric.impl.MBeanAttributeRatioLoadMetric" mode="On Demand">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttributeRatio",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
+    <constructor>
+      <parameter><inject bean="MBeanQueryLoadMetricSource"/></parameter>
+      <parameter><!-- dividend attribute --></parameter>
+      <parameter><!-- divisor attribute --></parameter>
+    </constructor>
+  </bean>
+  <!-- Queries for mbeans matching the specified pattern -->
+  <bean name="MBeanQueryLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.MBeanQueryLoadMetricSource" mode="On Demand">
+    <constructor>
+      <parameter><!-- ObjectName pattern --></parameter>
+      <parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+    </constructor>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: trunk/tomcat/src/resources/mod_cluster/mod_cluster-local-jboss-beans.xml
===================================================================
--- trunk/tomcat/src/resources/mod_cluster/mod_cluster-local-jboss-beans.xml	                        (rev 0)
+++ trunk/tomcat/src/resources/mod_cluster/mod_cluster-local-jboss-beans.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Beans that provide JBoss AS-side functionality for mod_cluster. These
+  beans are all "On Demand", i.e. that are not installed unless requested.
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="ModClusterListener" class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter">
+    <constructor>
+      <!-- To use the HA singleton version of mod_cluster, change this injection to HAModClusterService -->
+      <parameter class="org.jboss.modcluster.ContainerEventHandler"><inject bean="ModClusterService"/></parameter>
+      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+    </constructor>
+    <depends>WebServer</depends>
+  </bean>
+
+</deployment>
\ No newline at end of file

Deleted: trunk/tomcat/src/resources/mod_cluster-jboss-beans.xml
===================================================================
--- trunk/tomcat/src/resources/mod_cluster-jboss-beans.xml	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/tomcat/src/resources/mod_cluster-jboss-beans.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -1,320 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Beans that provide JBoss AS-side functionality for mod_cluster. These
-  beans are all "On Demand", i.e. that are not installed unless requested.
--->
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-  <!-- To enable mod_cluster, uncomment the matching <depends/> within the WebServer bean located in:
-       deploy/jbossweb.sar/META-INF/jboss-beans.xml
-       The configured mod_cluster service must start before (and stop after) the WebServer bean. -->
-  <bean name="ModClusterListener" class="org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter" mode="On Demand">
-    <constructor>
-      <!-- To use the HA singleton version of mod_cluster, change this injection to HAModClusterService -->
-      <parameter class="org.jboss.modcluster.ContainerEventHandler"><inject bean="ModClusterService"/></parameter>
-      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
-    </constructor>
-  </bean>
-  
-  <!-- The core mod_cluster service -->
-  <bean name="ModClusterService" class="org.jboss.modcluster.ModClusterService" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
-    <constructor>
-      <parameter class="org.jboss.modcluster.config.ModClusterConfig"><inject bean="ModClusterConfig"/></parameter>
-      <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
-    </constructor>
-  </bean>
-        
-  <!-- The core mod_cluster service, implemented as an HA singleton -->
-  <!-- The HA partition allows mod_cluster to detect and handle crashed members -->
-  <bean name="HAModClusterService" class="org.jboss.modcluster.ha.HAModClusterService" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ha.HAModClusterServiceMBean.class)</annotation>
-    <constructor>
-      <parameter class="org.jboss.modcluster.config.ha.HAModClusterConfig"><inject bean="ModClusterConfig"/></parameter>
-      <parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
-      <parameter class="org.jboss.ha.framework.interfaces.HAPartition"><inject bean="HAPartition"/></parameter>
-      <parameter class="org.jboss.ha.framework.interfaces.HASingletonElectionPolicy"><bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"/></parameter>
-    </constructor>
-  </bean>
-  
-  <!-- Configure this node's communication with the load balancer -->
-  <bean name="ModClusterConfig" class="org.jboss.modcluster.config.ha.HAModClusterConfig" mode="On Demand">
-    
-    <!-- Comma separated list of address:port listing the httpd servers
-         where mod_cluster is running. -->
-    <property name="proxyList">${jboss.mod_cluster.proxyList:}</property>
-    
-    <!-- URL prefix to send with commands to mod_cluster.  Default is no prefix. -->
-    <!--property name="proxyURL"></property-->
-    
-    <!-- mod_advertise is a small httpd module that advertises the 
-         availability of httpd servers via multicast, allowing 
-         ModClusterService to discover the httpd front-end instead of/in 
-         addition to having them defined in proxyList. -->
-    <!-- Whether to listen for advertise messages -->
-    <property name="advertise">${jboss.mod_cluster.advertise.enabled:false}</property>
-    
-    <!-- Multicast address on which to listen for advertisements -->
-    <property name="advertiseGroupAddress">
-      <value-factory bean="ServiceBindingManager" method="getStringBinding">
-        <parameter>ModClusterService</parameter>
-        <parameter>AdvertiseGroup</parameter>
-        <parameter><null/></parameter>
-      </value-factory>
-    </property>
-    <!-- Port on which to listen for advertisements -->
-    <property name="advertisePort">
-      <value-factory bean="ServiceBindingManager" method="getIntBinding">
-        <parameter>ModClusterService</parameter>
-        <parameter>AdvertiseGroup</parameter>
-      </value-factory>
-    </property>
-    <!-- Network interface address on which to listen for advertisements -->
-    <property name="advertiseInterface">
-      <value-factory bean="ServiceBindingManager" method="getStringBinding">
-        <parameter>ModClusterService</parameter>
-        <parameter>AdvertiseGroupInterface</parameter>
-        <parameter><null/></parameter>
-      </value-factory>
-    </property>
-    
-    <!-- Override the java.util.concurrent.ThreadFactory used by the advertise listener -->
-    <!--property name="advertiseThreadFactory"></property-->
-    
-    <!-- Comma delimited list of contexts that should *not* be auto-registered with httpd. -->
-    <!-- ROOT indicates the root context. -->
-    <!-- Context may be qualified by host using a colon, e.g. host1:context1 -->
-    <!-- If no host is defined, localhost is assumed. -->
-    <property name="excludedContexts">${jboss.mod_cluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console}</property>
-    <!-- If disabled, contexts will *not* auto-enable during startup/deploy, and instead be enabled manually -->
-    <property name="autoEnableContexts">${jboss.mod_cluster.autoEnableContexts:true}</property>
-    
-    <!-- Security key the proxy is going to send with advertise messages. 
-         Default is none. -->
-    <!--property name="advertiseSecurityKey"></property-->
-    
-    <!-- Whether to use SSL to communicate with mod_cluster. Note this
-         has nothing to do with handling of https requests by JBoss Web -->
-    <property name="ssl">false</property>
-    
-    <!-- Use domains to group nodes into fail-over groups -->
-    <!-- Requests stuck to a node that is no longer available with fail over to a node within the same domain, if possible -->
-    <!-- Typically used in concert with sticky sessions and buddy replication -->
-    <!--property name="domain"></property-->
-    
-    <!-- Should we use an HA singleton per domain? -->
-    <!--property name="masterPerDomain"></property-->
-    
-    <!-- Configuration values for the load balancer itself (must be the
-         same on all nodes in the cluster). These will be passed to the 
-         load balancer. -->
-    <property name="stickySession">true</property>
-    <property name="stickySessionForce">false</property>
-    <property name="stickySessionRemove">false</property>
-    <property name="maxAttempts">1</property>
-    <property name="workerTimeout">-1</property>
-  </bean>
-  
-  <!-- Provides information to ModClusterService informing it how much load 
-       this server should take.  This impl calculates the load factor from a 
-       number of metrics and adjusts the value periodically based on runtime
-       conditions, using the JBossWeb engine's backgroundProcessorDelay. -->
-  <bean name="DynamicLoadBalanceFactorProvider" class="org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProvider" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.DynamicLoadBalanceFactorProviderMBean.class)</annotation>
-    <constructor>
-      <parameter>
-        <!-- Define the load metrics to use in your load balance factor calculation here -->
-        <set elementClass="org.jboss.modcluster.load.metric.LoadMetric">
-          <inject bean="AverageSystemLoadMetric"/>
-          <inject bean="BusyConnectorsLoadMetric"/>
-        </set>
-      </parameter>
-    </constructor>
-    <!-- The number of historical load values used to determine load factor -->
-    <!--property name="history">9</property-->
-    <!-- The exponential decay factor for historical load values -->
-    <!--property name="decayFactor">2</property-->
-  </bean>
-
-  <!-- Default load metrics/sources -->
-
-  <!-- CPU usage -->
-  <!-- Perhaps the best metric for determining system load - but only available on Java 1.6 or later -->
-  <bean name="AverageSystemLoadMetric" class="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=AverageSystemLoad",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter><inject bean="OperatingSystemLoadMetricSource"/></parameter>
-    </constructor>
-    <!-- The weight determines the significance of this metric with respect
-         to others in the overall load balance factor calculation -->
-    <property name="weight">2</property>
-  </bean>
-  <!-- Uses the platform's OperatingSystemMXBean -->
-  <bean name="OperatingSystemLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.OperatingSystemLoadMetricSource" mode="On Demand"></bean>
-
-  <!-- The JBossWeb connector thread pool usage as a ratio of busy threads to max thread pool size -->
-  <!-- Analogous to method=B in mod_jk -->
-  <bean name="BusyConnectorsLoadMetric" class="org.jboss.modcluster.load.metric.impl.BusyConnectorsLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=BusyConnectors",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter><inject bean="ThreadPoolLoadMetricSource"/></parameter>
-    </constructor>
-    <property name="weight">1</property>
-  </bean>
-  <!-- Queries all JBossWeb ThreadPool mbeans -->
-  <bean name="ThreadPoolLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.ThreadPoolLoadMetricSource" mode="On Demand">
-    <constructor>
-      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
-      <!-- Object name pattern for connector thread pools -->
-      <!--parameter>jboss.web:type=ThreadPool,*</parameter-->
-    </constructor>
-  </bean>
-
-
-  <!-- Alternative load balance factor providers -->
-  
-  <!-- Basic impl that returns a static load balance factor.
-       This would replace the DynamicLoadBalanceFactorProvider
-       used above.
-   -->
-  <bean name="SimpleLoadBalanceFactorProvider" class="org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProvider" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor",exposedInterface=org.jboss.modcluster.load.impl.SimpleLoadBalanceFactorProviderMBean.class)</annotation>
-    <property name="loadBalanceFactor">1</property>
-  </bean>
-
-  <!-- 
-       Alternative load metrics, grouped by source. 
-       To use these, inject them into the set passed to the
-       DynamicLoadBalanceFactorProvider bean's constructor above.
-   -->
-  
-  <!-- The system memory usage as ratio of used memory to total memory size -->
-  <!-- Requires com.sun.management.OperatingSystemMXBean -->
-  <bean name="SystemMemoryUsageLoadMetric" class="org.jboss.modcluster.load.metric.impl.SystemMemoryUsageLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SystemMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter><inject bean="OperatingSystemLoadMetricSource"/></parameter>
-    </constructor>
-  </bean>
-
-  
-  <!-- The heap memory usage as a ratio of used heap to max heap size -->
-  <!-- N.B. This load metric is its own source -->
-  <bean name="HeapMemoryUsageLoadMetric" class="org.jboss.modcluster.load.metric.impl.HeapMemoryUsageLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=HeapMemoryUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-  </bean>
-
-
-  <!-- The number of requests/sec processed by the JBossWeb connectors, with respect to the defined capacity -->
-  <!-- Analogous to method=R in mod_jk -->
-  <bean name="RequestCountLoadMetric" class="org.jboss.modcluster.load.metric.impl.RequestCountLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=RequestCount",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
-      <!--parameter>requestCount</parameter-->
-    </constructor>
-    <!-- This metric requires an explicit capacity, e.g. maximum capacity of 1000 requests/sec -->
-    <property name="capacity">1000</property>
-  </bean>
-  <!-- The incoming traffic received by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
-  <!-- Analogous to method=T in mod_jk -->
-  <bean name="ReceiveTrafficLoadMetric" class="org.jboss.modcluster.load.metric.impl.ReceiveTrafficLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ReceiveTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
-      <!--parameter>bytesReceived</parameter-->
-    </constructor>
-    <!-- This metric requires an explicit capacity, e.g. max capacity of 1024 KB/s -->
-    <property name="capacity">1024</property>
-  </bean>
-  <!-- The outgoing traffic sent by JBossWeb connectors in KB/sec, with respect to the defined capacity -->
-  <bean name="SendTrafficLoadMetric" class="org.jboss.modcluster.load.metric.impl.SendTrafficLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=SendTraffic",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource"><inject bean="RequestProcessorLoadMetricSource"/></parameter>
-      <!--parameter>bytesSent</parameter-->
-    </constructor>
-    <!-- This metric requires an explicit capacity, e.g. max capacity of 512 KB/s -->
-    <property name="capacity">512</property>
-  </bean>
-  <!-- Queries all JBossWeb GlobalRequestProcessor mbeans -->
-  <bean name="RequestProcessorLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.RequestProcessorLoadMetricSource" mode="On Demand">
-    <constructor>
-      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
-      <!-- Object name pattern for request processors -->
-      <!--parameter>jboss.web:type=GlobalRequestProcessor,*</parameter-->
-    </constructor>
-  </bean>
-
-
-  <!-- The number of active sessions, with respect to the defined capacity -->
-  <!-- Analogous to method=S in mod_jk -->
-  <bean name="ActiveSessionsLoadMetric" class="org.jboss.modcluster.load.metric.impl.ActiveSessionsLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ActiveSessions",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter><inject bean="SessionLoadMetricSource"/></parameter>
-      <!--parameter>activeSessions</parameter-->
-    </constructor>
-    <!-- This metric requires an explicit capacity, e.g. max capacity of 1000 active sessions -->
-    <property name="capacity">1000</property>
-  </bean>
-  <!-- Queries all JBossWeb session manager mbeans -->
-  <bean name="SessionLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.SessionLoadMetricSource" mode="On Demand">
-    <constructor>
-      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
-      <!-- Object name pattern for session managers -->
-      <!--parameter>jboss.web:type=Manager,*</parameter-->
-    </constructor>
-  </bean>
-
-  
-  <!-- Returns the connection pool usage as a ratio of used to max pool size -->
-  <bean name="ConnectionPoolUsageMetric" class="org.jboss.modcluster.load.metric.impl.ConnectionPoolUsageLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=ConnectionPoolUsage",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter><inject bean="ConnectionPoolLoadMetricSource"/></parameter>
-      <!--parameter>InUseConnectionCount</parameter-->
-      <!--parameter>MaxSize</parameter-->
-    </constructor>
-  </bean>
-  <!-- Queries all JCA connection pools -->
-  <bean name="ConnectionPoolLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.ConnectionPoolLoadMetricSource" mode="On Demand">
-    <constructor>
-      <parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
-      <!-- Object name pattern for connector thread pools -->
-      <!--parameter>jboss.jca:service=ManagedConnectionPool,*</parameter-->
-    </constructor>
-  </bean>
-
-  <!-- Generic load metrics/sources -->
-  
-  <!-- Uses the sum of the values of the specified attribute for each
-       mbean matching the query, with respect to a defined capacity. -->
-  <bean name="MBeanAttributeLoadMetric" class="org.jboss.modcluster.load.metric.impl.MBeanAttributeLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttribute",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter><inject bean="MBeanQueryLoadMetricSource"/></parameter>
-      <parameter><!-- mbean attribute --></parameter>
-    </constructor>
-    <property name="capacity">1</property>
-  </bean>
-  <!-- Uses the ratio of the sum of the values of the specified dividend attribute,
-       to the sum of the values of the specified divisor attribute for each mbean
-       matching the query. -->
-  <bean name="MBeanAttributeRatioLoadMetric" class="org.jboss.modcluster.load.metric.impl.MBeanAttributeRatioLoadMetric" mode="On Demand">
-    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster,provider=LoadBalanceFactor,metric=MBeanAttributeRatio",exposedInterface=org.jboss.modcluster.load.metric.LoadMetricMBean.class)</annotation>
-    <constructor>
-      <parameter><inject bean="MBeanQueryLoadMetricSource"/></parameter>
-      <parameter><!-- dividend attribute --></parameter>
-      <parameter><!-- divisor attribute --></parameter>
-    </constructor>
-  </bean>
-  <!-- Queries for mbeans matching the specified pattern -->
-  <bean name="MBeanQueryLoadMetricSource" class="org.jboss.modcluster.load.metric.impl.MBeanQueryLoadMetricSource" mode="On Demand">
-    <constructor>
-      <parameter><!-- ObjectName pattern --></parameter>
-      <parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
-    </constructor>
-  </bean>
-
-</deployment>
\ No newline at end of file

Modified: trunk/tomcat/src/resources/server.xml
===================================================================
--- trunk/tomcat/src/resources/server.xml	2010-05-18 01:47:27 UTC (rev 104898)
+++ trunk/tomcat/src/resources/server.xml	2010-05-18 02:17:49 UTC (rev 104899)
@@ -5,9 +5,6 @@
    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
    <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
    <Listener className="org.apache.catalina.core.JasperListener" />
-   <!-- Required for mod_cluster integration, will be ignored if mod_cluster is not enabled -->
-   <Listener className="org.jboss.web.tomcat.service.deployers.MicrocontainerIntegrationLifecycleListener"
-             delegateBeanName="ModClusterListener" failIfBeanMissing="false" warnIfBeanMissing="false"/>
 
    <Service name="jboss.web">
 




More information about the jboss-cvs-commits mailing list