[jboss-cvs] JBossAS SVN: r90011 - in trunk: testsuite/src/main/org/jboss/test/cluster/defaultcfg/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jun 9 18:15:50 EDT 2009
Author: bstansberry at jboss.com
Date: 2009-06-09 18:15:50 -0400 (Tue, 09 Jun 2009)
New Revision: 90011
Modified:
trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java
Log:
[JBAS-6094] Expose lifecycle methods as managed operations
Modified: trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java 2009-06-09 22:13:58 UTC (rev 90010)
+++ trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java 2009-06-09 22:15:50 UTC (rev 90011)
@@ -1855,6 +1855,41 @@
this.kernelControllerContext = null;
}
+ // ManagedObject interface for lifecycle ----------------------------------
+
+
+ @ManagementOperation(description="Create the HAPartition",
+ impact=Impact.WriteOnly)
+ @Override
+ public void create() throws Exception
+ {
+ super.create();
+ }
+
+ @ManagementOperation(description="Start the HAPartition",
+ impact=Impact.WriteOnly)
+ @Override
+ public void start() throws Exception
+ {
+ super.start();
+ }
+
+ @ManagementOperation(description="Stop the HAPartition",
+ impact=Impact.WriteOnly)
+ @Override
+ public void stop()
+ {
+ super.stop();
+ }
+
+ @ManagementOperation(description="Destroy the HAPartition",
+ impact=Impact.WriteOnly)
+ @Override
+ public void destroy()
+ {
+ super.destroy();
+ }
+
// ManagedObject interface for DRM ---------------------------------------
@ManagementOperation(description="List all known DistributedReplicantManager keys and the nodes that have registered bindings",
@@ -1863,7 +1898,7 @@
{
return this.replicantManager == null ? null : this.replicantManager.listContent();
}
-
+
@ManagementOperation(description="List in XML format all known DistributedReplicantManager keys and the nodes that have registered bindings",
impact=Impact.ReadOnly)
public String listDRMContentAsXml() throws Exception
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java 2009-06-09 22:13:58 UTC (rev 90010)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ClusterPartitionManagedObjectsTestCase.java 2009-06-09 22:15:50 UTC (rev 90011)
@@ -22,10 +22,8 @@
package org.jboss.test.cluster.defaultcfg.test;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
-import java.util.Set;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -155,10 +153,20 @@
val = ((SimpleValue) result).getValue();
assertTrue(val instanceof Boolean);
- // FIXME test for service lifecycle
+ mgdop = operations.get("create");
+ assertNotNull("HAPartition has create", mgdop);
- assertEquals("Correct number of operations", 8, operations.size());
+ mgdop = operations.get("start");
+ assertNotNull("HAPartition has start", mgdop);
+ mgdop = operations.get("stop");
+ assertNotNull("HAPartition has stop", mgdop);
+
+ mgdop = operations.get("destroy");
+ assertNotNull("HAPartition has destroy", mgdop);
+
+ assertEquals("Correct number of operations", 12, operations.size());
+
for (Map.Entry<String, ManagedProperty> entry : mc.getProperties().entrySet())
{
getLog().debug(entry.getKey() + " == " + entry.getValue());
More information about the jboss-cvs-commits
mailing list