public static void ThreadProc() // Creates the thread process used for communication with MotherBuilder { bool result = true; while (result) { CommMessage MessageCommunication = childbuilder.getMessage(); MessageCommunication.show(); if (MessageCommunication.command == "BUILD") { BuildRequestName = MessageCommunication.xmlString; startBuildProcess(MessageCommunication.xmlString); } if (MessageCommunication.command == "Kill") { childbuilder.closeConnection(); CommMessage ReceiverClose = new CommMessage(CommMessage.MessageType.closeReceiver); ReceiverClose.from = "http://localhost:" + PortChildBuilder.ToString() + "/IMessagePassingComm"; ReceiverClose.to = MessageCommunication.from; ReceiverClose.author = "Child" + PortChildBuilder.ToString(); childbuilder.postMessage(ReceiverClose); result = false; } if (MessageCommunication.command == "SentFiles") { ProcessBuild(); } } }
public static void ReadyMessage() { CommMessage send = new CommMessage(CommMessage.MessageType.request); send.from = "http://localhost:" + PortChildBuilder.ToString() + "/IMessagePassingComm"; send.to = "http://localhost:8083/IMessagePassingComm"; send.author = "Butchi Venkata Akhil Rao"; send.command = "READY"; send.fileName = FolderPath + "/"; send.show(); childbuilder.postMessage(send); }
public static void startBuildProcess(string buildRequest) // Initiating the thread process { XmlParsing xml = new XmlParsing(); xml.XMLLoad("../../../RepositoryStorage/" + buildRequest); Author = xml.Parse("author"); DateTime = xml.Parse("dateTime"); Tested = xml.ParseList("tested"); String testDriver = xml.Parse("testDriver"); Tested.Add(testDriver); CommMessage requestFiles = new CommMessage(CommMessage.MessageType.request); requestFiles.author = "ChildBuilder"; requestFiles.command = "RequestParsedFiles"; requestFiles.fileName = FolderPath + "/"; requestFiles.from = "http://localhost:" + PortChildBuilder.ToString() + "/IMessagePassingComm"; requestFiles.to = "http://localhost:8081/IMessagePassingComm"; requestFiles.arguments = Tested; childbuilder.postMessage(requestFiles); }