[jboss-cvs] JBossAS SVN: r58558 - trunk/cluster/src/etc

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Nov 18 06:22:01 EST 2006


Author: bstansberry at jboss.com
Date: 2006-11-18 06:22:00 -0500 (Sat, 18 Nov 2006)
New Revision: 58558

Added:
   trunk/cluster/src/etc/deploy-hasingleton-beans.xml
   trunk/cluster/src/etc/farm-beans.xml
Log:
Use -beans.xml for clustering services

Added: trunk/cluster/src/etc/deploy-hasingleton-beans.xml
===================================================================
--- trunk/cluster/src/etc/deploy-hasingleton-beans.xml	2006-11-18 11:21:03 UTC (rev 58557)
+++ trunk/cluster/src/etc/deploy-hasingleton-beans.xml	2006-11-18 11:22:00 UTC (rev 58558)
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  This service ensures that exactly one node in the cluster            -->
+<!--  deploys the services under "deploy-hasingleton" 		         	   -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+   <!-- 
+    |
+    | Deployment scanner that can be called by an HASingletonController
+    |
+   -->
+   <bean name="HASingletonDeploymentScanner" class="org.jboss.ha.singleton.HASingletonDeploymentScanner">
+      
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=HASingletonDeploymentScanner,partitionName=${jboss.partition.name:DefaultPartition}", exposedInterface=org.jboss.ha.singleton.HASingletonDeploymentScannerMBean.class, registerDirectly=true)</annotation>
+         
+      <property name="profileService"><inject bean="ProfileService"/></property>
+      <property name="filterInstance"><inject bean="DeploymentFilter"/></property>
+   </bean>
+ 
+   <!--
+    |
+    | Use the deployer service on the singleton node. 
+    |
+   -->
+   <bean name="HASingletonDeployer" 
+   		 class="org.jboss.ha.singleton.HASingletonController">  
+      
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.ha:service=HASingletonDeployer", exposedInterface=org.jboss.ha.singleton.HASingletonControllerMBean.class, registerDirectly=true)</annotation>       
+      
+      <depends>HAPartition</depends>
+      
+      <property name="clusterPartition"><inject bean="HAPartition"/></property>
+      <property name="target"><inject bean="HASingletonDeploymentScanner"/></property>
+      <property name="targetStartMethod">deploySingletons</property>
+      <property name="targetStartMethodArgument">${jboss.server.home.url}${/}deploy-hasingleton</property>
+      <property name="targetStopMethod">undeploySingletons</property>
+      <property name="targetStopMethodArgument">${jboss.server.home.url}${/}deploy-hasingleton</property>
+      
+   </bean>
+
+   <!--
+    | A BarrierController that controls the lifecycle of a Barrier mbean
+    | based on notifications received by the HASingletonController above.
+    |
+    | Services deployed normally inside ./deploy or ./farm that want to be
+    | started/stopped whenever the content of ./deploy-hasingleton/ gets
+    | deployed/undeployed, or else, whenever the current node becomes the
+    | master, need only specify a dependency on the Barrier:
+    |
+    |    <depends>jboss.ha:service=HASingletonDeployer,type=Barrier</depends>
+    |
+    | With this setup the Barrier and all services that depend on it
+    | will be started *after* the content of deploy-hasingleton is deployed.
+    | To change this, just use the following enabled notification types:
+    |
+    |    <enable type="org.jboss.ha.singleton.starting"/>
+    |    <enable type="org.jboss.ha.singleton.stopped"/>
+   -->
+   <bean class="org.jboss.system.BarrierController"
+          name="jboss.ha:service=HASingletonDeployer,type=BarrierController">
+    
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.ha:service=HASingletonDeployer,type=BarrierController", exposedInterface=org.jboss.system.BarrierControllerMBean.class, registerDirectly=true)</annotation> 
+            
+      <!-- Dependent services will depend on this mbean -->
+      <property name="barrierObjectName">jboss.ha:service=HASingletonDeployer,type=Barrier</property>
+    
+      <!-- Whether to subscribe for notifications after startup -->
+      <property name="dynamicSubscriptions">false</property>    
+      <!-- The notification subscription handback that starts the barrier -->
+      <property name="startBarrierHandback">start</property>
+      <!-- The notification subscription handback that stops the barrier -->
+      <property name="stopBarrierHandback">stop</property>
+    
+      <!-- The notifications to subscribe for, along with their handbacks -->
+      <property name="subscriptions">
+         <list>
+            <!--value-->
+               <bean name="HASingletonDeployerStartSubscription" class="org.jboss.system.ListenerServiceMBeanSupport$SubscriptionInfo">
+                     <constructor>
+                        <parameter>jboss.ha:service=HASingletonDeployer</parameter>
+                        <parameter>start</parameter>
+                        <parameter>
+                        	<bean name="HASingletonDeployerStartSubscriptionNotificationFilter" class="javax.management.NotificationFilterSupport">
+                        		<install method="enableType">
+                        			<parameter>org.jboss.ha.singleton.started</parameter>
+                        		</install>
+                        	</bean>
+                        </parameter>
+                     </constructor>
+               </bean>
+            <!--/value>
+            <value-->
+               <bean name="HASingletonDeployerStopSubscription" class="org.jboss.system.ListenerServiceMBeanSupport$SubscriptionInfo">
+                     <constructor>
+                        <parameter>jboss.ha:service=HASingletonDeployer</parameter>
+                        <parameter>stop</parameter>
+                        <parameter>
+                        	<bean  name="HASingletonDeployerStopSubscriptionNotificationFilter" class="javax.management.NotificationFilterSupport">
+                        		<install method="enableType">
+                        			<parameter>org.jboss.ha.singleton.stopping</parameter>
+                        		</install>
+                        	</bean>
+                        </parameter>
+                     </constructor>
+               </bean>
+            <!--/value-->        
+         </list>
+      </property>
+   </bean>
+   
+</deployment>

Added: trunk/cluster/src/etc/farm-beans.xml
===================================================================
--- trunk/cluster/src/etc/farm-beans.xml	2006-11-18 11:21:03 UTC (rev 58557)
+++ trunk/cluster/src/etc/farm-beans.xml	2006-11-18 11:22:00 UTC (rev 58558)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   
+   <bean name="FarmMemberService"
+   		 class="org.jboss.ha.framework.server.FarmMemberService">
+   	
+   	<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=FarmMember,partitionName=${jboss.partition.name:DefaultPartition}", exposedInterface=org.jboss.ha.framework.server.FarmMemberServiceMBean.class, registerDirectly=true)</annotation>	 
+   	
+   	<depends>HAPartition</depends>
+   	   
+   	<property name="clusterPartition"><inject bean="HAPartition"/></property>
+   	<property name="deployer"><inject bean="MainDeployer"/></property>
+   	   
+   	<!-- The URLComparator can be used to specify a deployment ordering
+         for deployments found in a scanned directory.  The class specified
+         must be an implementation of java.util.Comparator, it must be able
+         to compare two URL objects, and it must have a no-arg constructor.
+         Two deployment comparators are shipped with JBoss:
+           - org.jboss.deployment.DeploymentSorter 
+             Sorts by file extension, as follows:
+               "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip", 
+               "*"
+           - org.jboss.deployment.scanner.PrefixDeploymentSorter
+             If the name portion of the url begins with 1 or more digits, those 
+             digits are converted to an int (ignoring leading zeroes), and 
+             files are deployed in that order.  Files that do not start with 
+             any digits will be deployed last, and they will be sorted by
+             extension as above with DeploymentSorter.
+    -->
+    <property name="URLComparator">org.jboss.deployment.DeploymentSorter</property>
+    <!--
+    <property name="URLComparator">org.jboss.deployment.scanner.PrefixDeploymentSorter</property>
+    -->
+    
+    <!-- The Filter specifies a java.io.FileFilter for scanned
+         directories.  Any file not accepted by this filter will not be
+         deployed.  The org.jboss.deployment.scanner.DeploymentFilter 
+         rejects the following patterns:
+             "#*", "%*", ",*", ".*", "_$*", "*#", "*$", "*%", "*.BAK", 
+             "*.old", "*.orig", "*.rej", "*.bak", "*,v", "*~", ".make.state", 
+             ".nse_depinfo", "CVS", "CVS.admin", "RCS", "RCSLOG", "SCCS", 
+             "TAGS", "core", "tags"
+    -->
+    <property name="filter">org.jboss.deployment.scanner.DeploymentFilter</property>
+
+    <property name="scanPeriod">5000</property>
+    
+   	<!-- URLs are comma seperated and unprefixed arguments are considered
+       file URLs and resolve relative to server home(JBOSS_DIST/server/default)
+       unless the given path is absolute. Any referenced directories cannot
+       be unpackaged archives, use the parent directory of the unpacked
+       archive.
+     -->
+      <property name="URLList">
+         <list elementClass="java.net.URL">
+            <!-- Directory for deployers -->
+            <value>${jboss.server.home.url}farm/</value>
+         </list>
+      </property>
+     
+   </bean>
+   
+</deployment>




More information about the jboss-cvs-commits mailing list