From 223550b7e4f9eb534728e7763642a2ba6154be96 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 27 Jun 2007 15:03:54 +0000 Subject: Some very Preliminary work on .net remoting for interregion comms. a few more classes for CAPS LLSD types. --- .../GridServerManager.cs | 110 ++++++++++----------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'OpenGridServices') diff --git a/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs b/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs index d665ab4..e276556 100644 --- a/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs +++ b/OpenGridServices/OpenGrid.Framework.Manager/GridServerManager.cs @@ -24,71 +24,71 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * -*/ - -using System; -using System.Collections; -using System.Collections.Generic; -using Nwc.XmlRpc; -using System.Threading; -using libsecondlife; - -namespace OpenGrid.Framework.Manager { - +*/ + +using System; +using System.Collections; +using System.Collections.Generic; +using Nwc.XmlRpc; +using System.Threading; +using libsecondlife; + +namespace OpenGrid.Framework.Manager { + /// /// A remote management system for the grid server - /// - public class GridServerManager - { + /// + public class GridServerManager + { /// /// Triggers events from the grid manager - /// - public static GridManagerCallback thecallback; - + /// + public static GridManagerCallback thecallback; + /// /// Security keys - /// - public static string sendkey; - public static string recvkey; - + /// + public static string sendkey; + public static string recvkey; + /// /// Disconnects the grid server and shuts it down /// /// XmlRpc Request - /// An XmlRpc response containing either a "msg" or an "error" - public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) - { - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable requestData = (Hashtable)request.Params[0]; - Hashtable responseData = new Hashtable(); - - if(requestData.ContainsKey("session_id")) { - if(GridManagementAgent.SessionExists(new LLUUID((string)requestData["session_id"]))) { - responseData["msg"]="Shutdown command accepted"; - (new Thread(new ThreadStart(ShutdownServer))).Start(); - } else { - response.IsFault=true; - responseData["error"]="bad session ID"; - } - } else { - response.IsFault=true; - responseData["error"]="no session ID"; - } - - response.Value = responseData; - return response; - } - + /// An XmlRpc response containing either a "msg" or an "error" + public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + Hashtable responseData = new Hashtable(); + + if(requestData.ContainsKey("session_id")) { + if(GridManagementAgent.SessionExists(new LLUUID((string)requestData["session_id"]))) { + responseData["msg"]="Shutdown command accepted"; + (new Thread(new ThreadStart(ShutdownServer))).Start(); + } else { + response.IsFault=true; + responseData["error"]="bad session ID"; + } + } else { + response.IsFault=true; + responseData["error"]="no session ID"; + } + + response.Value = responseData; + return response; + } + /// /// Shuts down the grid server - /// - public static void ShutdownServer() - { + /// + public static void ShutdownServer() + { Console.WriteLine("Shutting down the grid server - recieved a grid manager request"); - Console.WriteLine("Terminating in three seconds..."); - Thread.Sleep(3000); - thecallback("shutdown"); - } - } -} - + Console.WriteLine("Terminating in three seconds..."); + Thread.Sleep(3000); + thecallback("shutdown"); + } + } +} + -- cgit v1.1