[jboss-cvs] JBossAS SVN: r61122 - trunk/testsuite/src/resources/ha/electionpolicy.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 6 00:35:36 EST 2007
Author: bstansberry at jboss.com
Date: 2007-03-06 00:35:36 -0500 (Tue, 06 Mar 2007)
New Revision: 61122
Added:
trunk/testsuite/src/resources/ha/electionpolicy/ha-electionpolicy-beans.xml
Removed:
trunk/testsuite/src/resources/ha/electionpolicy/META-INF/
Log:
Use a beans.xml for the HASingletonElectionPolicy test
Added: trunk/testsuite/src/resources/ha/electionpolicy/ha-electionpolicy-beans.xml
===================================================================
--- trunk/testsuite/src/resources/ha/electionpolicy/ha-electionpolicy-beans.xml (rev 0)
+++ trunk/testsuite/src/resources/ha/electionpolicy/ha-electionpolicy-beans.xml 2007-03-06 05:35:36 UTC (rev 61122)
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- First HASingleton, Election policy is to choose the oldest node as master -->
+ <bean class="org.jboss.ha.singleton.examples.HASingletonMBeanExample"
+ name="HASingletonMBeanExample_1">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.examples:service=HASingletonMBeanExample_1", exposedInterface=org.jboss.ha.singleton.examples.HASingletonMBeanExampleMBean.class, registerDirectly=true)</annotation>
+ </bean>
+
+ <bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"
+ name="HASingletonElectionPolicySimple_1">
+ <property name="position">0</property>
+ </bean>
+
+ <bean class="org.jboss.ha.singleton.HASingletonController"
+ name="HASingletonController_1">
+
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:service=HASingletonController_1", exposedInterface=org.jboss.ha.singleton.HASingletonControllerMBean.class, registerDirectly=true)</annotation>
+
+ <property name="clusterPartition"><inject bean="ElectionPolicyTestPartition"/></property>
+ <property name="electionPolicy"><inject bean="HASingletonElectionPolicySimple_1"/></property>
+ <property name="target"><inject bean="HASingletonMBeanExample_1"/></property>
+ <property name="targetStartMethod">startSingleton</property>
+ <property name="targetStopMethod">stopSingleton</property>
+ <property name="targetStopMethodArgument">true</property>
+ </bean>
+
+ <!-- Second HASingleton, Election policy is to choose the youngest node as master -->
+ <bean class="org.jboss.ha.singleton.examples.HASingletonMBeanExample"
+ name="HASingletonMBeanExample_2">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.examples:service=HASingletonMBeanExample_2", exposedInterface=org.jboss.ha.singleton.examples.HASingletonMBeanExampleMBean.class, registerDirectly=true)</annotation>
+ </bean>
+
+ <bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"
+ name="HASingletonElectionPolicySimple_2">
+ <property name="position">-1</property>
+ </bean>
+
+ <bean class="org.jboss.ha.singleton.HASingletonController"
+ name="HASingletonController_2">
+
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:service=HASingletonController_2", exposedInterface=org.jboss.ha.singleton.HASingletonControllerMBean.class, registerDirectly=true)</annotation>
+
+ <property name="clusterPartition"><inject bean="ElectionPolicyTestPartition"/></property>
+ <property name="electionPolicy"><inject bean="HASingletonElectionPolicySimple_2"/></property>
+ <property name="target"><inject bean="HASingletonMBeanExample_2"/></property>
+ <property name="targetStartMethod">startSingleton</property>
+ <property name="targetStopMethod">stopSingleton</property>
+ <property name="targetStopMethodArgument">true</property>
+ </bean>
+
+ <!-- Third HASingleton, Election policy is to choose the 2nd oldest node as master -->
+ <bean class="org.jboss.ha.singleton.examples.HASingletonMBeanExample"
+ name="HASingletonMBeanExample_3">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.examples:service=HASingletonMBeanExample_3", exposedInterface=org.jboss.ha.singleton.examples.HASingletonMBeanExampleMBean.class, registerDirectly=true)</annotation>
+ </bean>
+
+ <bean class="org.jboss.ha.singleton.HASingletonElectionPolicySimple"
+ name="HASingletonElectionPolicySimple_3">
+ <property name="position">1</property>
+ </bean>
+
+ <bean class="org.jboss.ha.singleton.HASingletonController"
+ name="HASingletonController_3">
+
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:service=HASingletonController_3", exposedInterface=org.jboss.ha.singleton.HASingletonControllerMBean.class, registerDirectly=true)</annotation>
+
+ <property name="clusterPartition"><inject bean="ElectionPolicyTestPartition"/></property>
+ <property name="electionPolicy"><inject bean="HASingletonElectionPolicySimple_3"/></property>
+ <property name="target"><inject bean="HASingletonMBeanExample_3"/></property>
+ <property name="targetStartMethod">startSingleton</property>
+ <property name="targetStopMethod">stopSingleton</property>
+ <property name="targetStopMethodArgument">true</property>
+ </bean>
+
+ <!-- Fourth HASingleton, No election policy defined. By default, the oldest node is selected -->
+ <bean class="org.jboss.ha.singleton.examples.HASingletonMBeanExample"
+ name="HASingletonMBeanExample_4">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.examples:service=HASingletonMBeanExample_4", exposedInterface=org.jboss.ha.singleton.examples.HASingletonMBeanExampleMBean.class, registerDirectly=true)</annotation>
+ </bean>
+
+ <bean class="org.jboss.ha.singleton.HASingletonController"
+ name="HASingletonController_4">
+
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:service=HASingletonController_4", exposedInterface=org.jboss.ha.singleton.HASingletonControllerMBean.class, registerDirectly=true)</annotation>
+
+ <property name="clusterPartition"><inject bean="ElectionPolicyTestPartition"/></property>
+ <property name="target"><inject bean="HASingletonMBeanExample_4"/></property>
+ <property name="targetStartMethod">startSingleton</property>
+ <property name="targetStopMethod">stopSingleton</property>
+ <property name="targetStopMethodArgument">true</property>
+ </bean>
+
+
+ <bean name="ElectionPolicyTestCacheConfig"
+ class="org.jboss.cache.config.Configuration">
+
+ <!-- Externally injected services -->
+ <property name="runtimeConfig">
+ <bean name="ElectionPolicyTestCacheRuntimeConfig" class="org.jboss.cache.config.RuntimeConfig">
+ <property name="transactionManager"><inject bean="jboss:service=TransactionManager" property="TransactionManager"/></property>
+ <property name="muxChannelFactory"><inject bean="jgroups.mux:name=Multiplexer"/></property>
+ </bean>
+ </property>
+
+ <property name="multiplexerStack">${jboss.multiplexer.stack:udp}</property>
+
+ <!-- Valid isolation levels are
+ SERIALIZABLE
+ REPEATABLE_READ (default)
+ READ_COMMITTED
+ READ_UNCOMMITTED
+ NONE
+ -->
+ <property name="isolationLevelString">REPEATABLE_READ</property>
+
+ <!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
+ <property name="cacheModeString">REPL_SYNC</property>
+
+ <!-- Just used for async repl: use a replication queue -->
+ <property name="useReplQueue">false</property>
+
+ <!-- Replication interval for replication queue (in ms) -->
+ <property name="replQueueInterval">0</property>
+
+ <!-- Max number of elements which trigger replication -->
+ <property name="replQueueMaxElements">10</property>
+
+ <!-- Name of cluster. Needs to be the same for all nodes in clusters,
+ in order to find each other -->
+ <property name="clusterName">ElectionPolicyTestPartitionCache</property>
+
+ <!-- Whether or not to fetch state on joining a cluster -->
+ <property name="fetchInMemoryState">true</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ initial state (ie. the contents of the cache) are retrieved from
+ existing members in a clustered environment -->
+ <property name="initialStateRetrievalTimeout">5000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">20000</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <property name="exposeManagementStatistics">true</property>
+
+ </bean>
+
+ <bean name="ElectionPolicyTestCacheFactory" class ="org.jboss.cache.DefaultCacheFactory">
+ <constructor factoryClass="org.jboss.cache.DefaultCacheFactory" factoryMethod="getInstance"/>
+ </bean>
+
+ <!-- Now we use the above configuration to construct the cache itself -->
+ <bean name="ElectionPolicyTestCache" class="org.jboss.cache.CacheImpl">
+
+ <depends>jboss:service=Naming</depends>
+
+ <constructor factoryMethod="createCache">
+ <factory bean="ElectionPolicyTestCacheFactory"/>
+ <parameter class="org.jboss.cache.config.Configuration"><inject bean="ElectionPolicyTestCacheConfig"/></parameter>
+ <parameter class="boolean">false</parameter>
+ </constructor>
+
+ </bean>
+
+ <!-- ==================================================================== -->
+ <!-- Partition used for testing failure to receive state -->
+ <!-- ==================================================================== -->
+
+ <bean name="ElectionPolicyTestPartition"
+ class="org.jboss.ha.framework.server.ClusterPartition">
+
+ <constructor>
+ <parameter>
+ <bean name="ElectionPolicyTestPartitionConfig" class="org.jboss.ha.framework.server.ClusterPartitionConfig">
+
+ <!-- ClusterPartition requires a Cache for state management -->
+ <property name="clusteredCache"><inject bean="ElectionPolicyTestCache"/></property>
+
+ <!--property name="distributedState"><inject bean="DistributedState"/></property-->
+
+ <!-- Name of the partition being built -->
+ <property name="partitionName">ElectionPolicyTestPartition</property>
+
+ <!-- The address used to determine the node name -->
+ <property name="nodeAddress">${jboss.bind.address}</property>
+
+ <!-- Inject the naming service port as an aid in creating a nodeUniqueId. Not needed if nodeUniqueId is set -->
+ <property name="namingServicePort"><inject bean="jboss:service=Naming" property="Port"/></property>
+
+ <!-- Determine if deadlock detection is enabled -->
+ <property name="deadlockDetection">false</property>
+
+ <!-- Max time (in ms) to wait for state transfer to complete. Increase for large states -->
+ <property name="stateTransferTimeout">2000</property>
+
+ <!-- Max time (in ms) to wait for RPC calls to complete. -->
+ <property name="methodCallTimeout">5000</property>
+
+ </bean>
+ </parameter>
+ </constructor>
+
+ </bean>
+
+</deployment>
More information about the jboss-cvs-commits
mailing list