Author: azeez
Date: Tue Dec 4 02:06:14 2007
New Revision: 10481
Log:
Added shutdown/restart server
Modified:
trunk/commons/adminui/www/js/main.js
Modified: trunk/commons/adminui/www/js/main.js
==============================================================================
--- trunk/commons/adminui/www/js/main.js (original)
+++ trunk/commons/adminui/www/js/main.js Tue Dec 4 02:06:14 2007
@@ -172,7 +172,7 @@
if (a.length > 0) {
reason = a[0];
}
- // This is to fix problems encountered in Windows browsers.
+ // This is to fix problems encountered in Windows browsers.
var status = this.req._xmlhttp.status;
if (status && status == 500) {
return;
@@ -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 = "";
_______________________________________________
Commons-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev