From e42c10fee5a715138a46ef1349e35db738a2a637 Mon Sep 17 00:00:00 2001
From: gareth
Date: Sat, 19 May 2007 00:22:58 +0000
Subject: Finished off the shutdown function Consumed 100mg caffeine
---
.../GridServerConnectionManager.cs | 20 ++++++++++++++++++++
.../OpenGridServices.Manager/Main.cs | 11 +++++++++++
.../OpenGridServices.Manager/MainWindow.cs | 5 +++++
.../gtk-gui/OpenGridServices.Manager.MainWindow.cs | 1 +
.../OpenGridServices.Manager/gtk-gui/gui.stetic | 1 +
5 files changed, 38 insertions(+)
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
index afd9a69..d7cbac9 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
@@ -39,5 +39,25 @@ namespace OpenGridServices.Manager
{
return true;
}
+
+ public bool ShutdownServer()
+ {
+ try {
+ Hashtable ShutdownParamsHT = new Hashtable();
+ ArrayList ShutdownParams = new ArrayList();
+ ShutdownParams.Add(ShutdownParamsHT);
+ XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams);
+ XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL,3000);
+ if(GridResp.IsFault) {
+ return false;
+ } else {
+ return true;
+ }
+ } catch(Exception e) {
+ Console.WriteLine(e.ToString());
+ return false;
+ }
+ }
+
}
}
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs b/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
index d5a9688..f2e4153 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
@@ -58,6 +58,17 @@ namespace OpenGridServices.Manager
win.SetStatus("Error restarting grid server!!!");
}
break;
+
+ case "shutdown_gridserver":
+ win.SetStatus("Shutting down grid server...");
+ if(gridserverConn.ShutdownServer()) {
+ win.SetStatus("Grid server shutdown");
+ Thread.Sleep(3000);
+ win.SetStatus("");
+ } else {
+ win.SetStatus("Could not shutdown grid server!!!");
+ }
+ break;
}
}
}
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs b/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs
index 5cf4bc1..ba61eed 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs
@@ -40,6 +40,11 @@ namespace OpenGridServices.Manager {
MainClass.PendingOperations.Enqueue("restart_gridserver");
}
+ protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e)
+ {
+ MainClass.PendingOperations.Enqueue("shutdown_gridserver");
+ }
+
}
}
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs
index c565b9b..49b6483 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/OpenGridServices.Manager.MainWindow.cs
@@ -353,6 +353,7 @@ namespace OpenGridServices.Manager {
this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu);
this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu);
+ this.ShutdownGridserverOnly.Activated += new System.EventHandler(this.ShutdownGridserverMenu);
this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu);
}
}
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic
index 2e04efa..4c6190f 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/gtk-gui/gui.stetic
@@ -99,6 +99,7 @@
Shutdown gridserver only
Shutdown gridserver only
gtk-stop
+
Action
--
cgit v1.1