[wsas-java-dev] svn commit r10480 - branches/wsas/java/2.1/commons/adminui/www/js

svn at wso2.org svn at wso2.org
Tue Dec 4 02:02:22 PST 2007


Author: azeez
Date: Tue Dec  4 02:02:18 2007
New Revision: 10480

Log:

Shutdown/Restart server gracefully



Modified:
   branches/wsas/java/2.1/commons/adminui/www/js/main.js

Modified: branches/wsas/java/2.1/commons/adminui/www/js/main.js
==============================================================================
--- branches/wsas/java/2.1/commons/adminui/www/js/main.js	(original)
+++ branches/wsas/java/2.1/commons/adminui/www/js/main.js	Tue Dec  4 02:02:18 2007
@@ -569,6 +569,35 @@
             new wso2.wsf.WSRequest(callURL, "urn:restartGracefully", bodyXML, wso2.wsf.Util.restartServerGracefully["callback"]);
         }
     },
+
+/*
+   This method will shutdown the server gracefully.
+*/
+    shutdownServerGracefully : function (callbackFunction) {
+        var bodyXML = '<req:shutdownGracefullyRequest xmlns:req="http://org.apache.axis2/xsd"/>\n';
+
+        var callURL = serverURL + "/" + ADMIN_SERVER_URL ;
+        if (callbackFunction && (typeof(callbackFunction) == "function")) {
+            new wso2.wsf.WSRequest(callURL, "urn:shutdownGracefully", bodyXML, callbackFunction);
+        } else {
+            new wso2.wsf.WSRequest(callURL, "urn:shutdownGracefully", bodyXML, wso2.wsf.Util.shutdownServerGracefully["callback"]);
+        }
+    },
+
+/*
+   This method will shutdown the server immediately.
+*/
+    shutdownServer : function (callbackFunction) {
+        var bodyXML = '<req:shutdownRequest xmlns:req="http://org.apache.axis2/xsd"/>\n';
+
+        var callURL = serverURL + "/" + ADMIN_SERVER_URL ;
+        if (callbackFunction && (typeof(callbackFunction) == "function")) {
+            new wso2.wsf.WSRequest(callURL, "urn:shutdown", bodyXML, callbackFunction);
+        } else {
+            new wso2.wsf.WSRequest(callURL, "urn:shutdown", bodyXML, wso2.wsf.Util.shutdownServer["callback"]);
+        }
+    },
+
 /*
 Trim the give string
 */
@@ -1060,6 +1089,15 @@
 
 }
 
+wso2.wsf.Util.shutdownServerGracefully["callback"] = function() {
+    logoutVisual();
+    stopWaitAnimation();
+    wso2.wsf.Util.alertMessage("The server is being gracefully shutdown. <br/> This will take a few seconds. ");
+    // stopping all refressing methods
+    stoppingRefreshingMethodsHook();
+
+}
+
 /*private*/
 function logoutVisual() {
     serviceGroupId = "";




More information about the Wsas-java-dev mailing list