diff options
Diffstat (limited to '')
5 files changed, 38 insertions, 0 deletions
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 | |||
39 | { | 39 | { |
40 | return true; | 40 | return true; |
41 | } | 41 | } |
42 | |||
43 | public bool ShutdownServer() | ||
44 | { | ||
45 | try { | ||
46 | Hashtable ShutdownParamsHT = new Hashtable(); | ||
47 | ArrayList ShutdownParams = new ArrayList(); | ||
48 | ShutdownParams.Add(ShutdownParamsHT); | ||
49 | XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams); | ||
50 | XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL,3000); | ||
51 | if(GridResp.IsFault) { | ||
52 | return false; | ||
53 | } else { | ||
54 | return true; | ||
55 | } | ||
56 | } catch(Exception e) { | ||
57 | Console.WriteLine(e.ToString()); | ||
58 | return false; | ||
59 | } | ||
60 | } | ||
61 | |||
42 | } | 62 | } |
43 | } | 63 | } |
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 | |||
58 | win.SetStatus("Error restarting grid server!!!"); | 58 | win.SetStatus("Error restarting grid server!!!"); |
59 | } | 59 | } |
60 | break; | 60 | break; |
61 | |||
62 | case "shutdown_gridserver": | ||
63 | win.SetStatus("Shutting down grid server..."); | ||
64 | if(gridserverConn.ShutdownServer()) { | ||
65 | win.SetStatus("Grid server shutdown"); | ||
66 | Thread.Sleep(3000); | ||
67 | win.SetStatus(""); | ||
68 | } else { | ||
69 | win.SetStatus("Could not shutdown grid server!!!"); | ||
70 | } | ||
71 | break; | ||
61 | } | 72 | } |
62 | } | 73 | } |
63 | } | 74 | } |
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 { | |||
40 | MainClass.PendingOperations.Enqueue("restart_gridserver"); | 40 | MainClass.PendingOperations.Enqueue("restart_gridserver"); |
41 | } | 41 | } |
42 | 42 | ||
43 | protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e) | ||
44 | { | ||
45 | MainClass.PendingOperations.Enqueue("shutdown_gridserver"); | ||
46 | } | ||
47 | |||
43 | } | 48 | } |
44 | } | 49 | } |
45 | 50 | ||
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 { | |||
353 | this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent); | 353 | this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent); |
354 | this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu); | 354 | this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu); |
355 | this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu); | 355 | this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu); |
356 | this.ShutdownGridserverOnly.Activated += new System.EventHandler(this.ShutdownGridserverMenu); | ||
356 | this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu); | 357 | this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu); |
357 | } | 358 | } |
358 | } | 359 | } |
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 @@ | |||
99 | <property name="Label" translatable="yes">Shutdown gridserver only</property> | 99 | <property name="Label" translatable="yes">Shutdown gridserver only</property> |
100 | <property name="ShortLabel" translatable="yes">Shutdown gridserver only</property> | 100 | <property name="ShortLabel" translatable="yes">Shutdown gridserver only</property> |
101 | <property name="StockId">gtk-stop</property> | 101 | <property name="StockId">gtk-stop</property> |
102 | <signal name="Activated" handler="ShutdownGridserverMenu" after="yes" /> | ||
102 | </action> | 103 | </action> |
103 | <action id="RestartGridserverOnly"> | 104 | <action id="RestartGridserverOnly"> |
104 | <property name="Type">Action</property> | 105 | <property name="Type">Action</property> |