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 = "";

_______________________________________________
Wsas-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev

Reply via email to