Author: remy.maucherat(a)jboss.com
Date: 2008-05-27 10:50:21 -0400 (Tue, 27 May 2008)
New Revision: 642
Modified:
trunk/java/org/jboss/web/cluster/ClusterListener.java
trunk/java/org/jboss/web/cluster/mbeans-descriptors.xml
trunk/webapps/docs/changelog.xml
Log:
- Add 3 new JMX callbacks.
Modified: trunk/java/org/jboss/web/cluster/ClusterListener.java
===================================================================
--- trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-05-27 13:47:39 UTC (rev
641)
+++ trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-05-27 14:50:21 UTC (rev
642)
@@ -252,6 +252,49 @@
/**
+ * Refresh configuration. To be used through JMX or similar.
+ */
+ public void refresh() {
+ // Set as error, and the periodic
+ if (state == State.OK) {
+ state = State.ERROR;
+ }
+ }
+
+
+ /**
+ * Disable all webapps for all engines. To be used through JMX or similar.
+ */
+ public boolean disable() {
+ Service[] services = ServerFactory.getServer().findServices();
+ for (int i = 0; i < services.length; i++) {
+ Engine engine = (Engine) services[i].getContainer();
+ HashMap<String, String> parameters = new HashMap<String,
String>();
+ parameters.put("JVMRoute", engine.getJvmRoute());
+ // Send DISABLE-APP * request
+ sendRequest("DISABLE-APP", true, parameters);
+ }
+ return (state == State.OK);
+ }
+
+
+ /**
+ * Enable all webapps for all engines. To be used through JMX or similar.
+ */
+ public boolean enable() {
+ Service[] services = ServerFactory.getServer().findServices();
+ for (int i = 0; i < services.length; i++) {
+ Engine engine = (Engine) services[i].getContainer();
+ HashMap<String, String> parameters = new HashMap<String,
String>();
+ parameters.put("JVMRoute", engine.getJvmRoute());
+ // Send ENABLE-APP * request
+ sendRequest("ENABLE-APP", true, parameters);
+ }
+ return (state == State.OK);
+ }
+
+
+ /**
* Send commands to the front end server assocaited with the startup of the
* node.
*/
Modified: trunk/java/org/jboss/web/cluster/mbeans-descriptors.xml
===================================================================
--- trunk/java/org/jboss/web/cluster/mbeans-descriptors.xml 2008-05-27 13:47:39 UTC (rev
641)
+++ trunk/java/org/jboss/web/cluster/mbeans-descriptors.xml 2008-05-27 14:50:21 UTC (rev
642)
@@ -38,6 +38,16 @@
impact="ACTION"
returnType="void"/>
+ <operation name="disable"
+ description="Disable all webapps for all engines"
+ impact="ACTION"
+ returnType="boolean"/>
+
+ <operation name="enable"
+ description="Enable all webapps for all engines"
+ impact="ACTION"
+ returnType="boolean"/>
+
</mbean>
</mbeans-descriptors>
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-05-27 13:47:39 UTC (rev 641)
+++ trunk/webapps/docs/changelog.xml 2008-05-27 14:50:21 UTC (rev 642)
@@ -38,6 +38,9 @@
<fix>
Improve fault recovery of ClusterListener. (remm)
</fix>
+ <update>
+ Add JMX callbacks to refresh configuration, enable and disable all contexts.
(remm)
+ </update>
</changelog>
</subsection>
<subsection name="Coyote">
Show replies by date