public InstrumentDataEnQueueJob(MessageViewModel e_mvm) { this.MessageViewModel_ = e_mvm; //this.xmlDoc_ = new XmlDocument(); }
public void send(MessageViewModel msg) { // msg targer search TargetServerInfoViewModel tsivm = TargerServerMap_[msg.TargetCode_]; AsynchronousClient client = new AsynchronousClient(); //client.StartClient(msg, tsivm); this.result_ = "message recieve complete"; }
public void calculate(List<Excel_instrumentViewModel> instList, DateTime refDate) { MessageManager messageManager = new MessageManager(); messageManager.loadServerInformation(); foreach (var item in instList) { item.loadBatchDetailContext(); item.buildParameterFromInstrument(refDate); //item.calculateSavedXml(refDate); MessageViewModel mvm = new MessageViewModel(); mvm.MessageHeaderViewModel_.MessageType_ = "ENQUEUE"; GridCalculationViewModel gcvm = MessageBodyViewModel.CreateMessageBody("gridCalculation") as GridCalculationViewModel; gcvm.Inst_code_ = item.MasterInformationViewModel_.Item_code_; gcvm.Inst_name_ = item.MasterInformationViewModel_.Item_name_; gcvm.Inst_type_ = item.MasterInformationViewModel_.Booking_type_; gcvm.Para_refDate_ = item.Excel_parameterViewModel_.ReferenceDate_; gcvm.InnerXml_ = item.calculationXml(); mvm.TargetCode_ = "gridCalculation"; mvm.MessageBodyViewModel_ = gcvm; messageManager.send(mvm); } // 다 보냄 우선 // 글고 //MessageViewModel calStartMsgVM = new MessageViewModel(); //calStartMsgVM.MessageHeaderViewModel_.MessageType_ = "GRIDCALCULATIONSTART"; //GridCalculationStartViewModel gcsvm = new GridCalculationStartViewModel(); //calStartMsgVM.MessageBodyViewModel_ = gcsvm; //calStartMsgVM.TargetCode_ = "gridCalculation"; //messageManager.send(calStartMsgVM); }
public void parsing() { this.xmlDoc_ = new XmlDocument(); this.xmlDoc_.LoadXml(this.messageText_); XmlNode xmlNode = this.xmlDoc_.SelectSingleNode("message"); FpmlSerializedCSharp.Message serial_message = new FpmlSerializedCSharp.Message(xmlNode); Excel_Interface.MessageViewModel e_mvm = new MessageViewModel(); e_mvm.setFromSerial(serial_message); this.messageViewModel_ = e_mvm; string type = messageViewModel_.MessageHeaderViewModel_.MessageType_; this.jobAction_ = this.getJobAction(type, e_mvm); }
private JobAction getJobAction(string type,MessageViewModel e_mvm) { JobAction ja; if (type.ToUpper() == "ENQUEUE") { ja = new InstrumentDataEnQueueJob(e_mvm); } else if (type.ToUpper() == "GRIDCALCULATIONSTART") { ja = new CalculationStartJob(e_mvm); } else if (type.ToUpper() == "ENQUEUE") { ja = new InstrumentDataEnQueueJob(e_mvm); } else { ja = new InstrumentDataEnQueueJob(e_mvm); } return ja; }
public CalculationServerInfoJob(MessageViewModel e_mvm) { this.MessageViewModel_ = e_mvm; }
public CalculationStartJob(MessageViewModel e_mvm) { }
public void calculateStart() { this.calculationStartTime_ = DateTime.Now; //List<AsynchronousClient> clients = new List<AsynchronousClient>(); //List<string> messageXmls = new List<string>(); List<Task> taskList = new List<Task>(); // 여기서는 task 를 띄움( multi-thread 로 가도됨 ) if (useLocalServerTF_) { for (int i = 0; i < this.BatchItemViewModelQueueList_.Count; i++) { AsynchronousClient client = new AsynchronousClient(); MessageViewModel mvm = new MessageViewModel(); mvm.MessageHeaderViewModel_.CreationTimestamp_ = DateTime.Now.ToString(); mvm.MessageHeaderViewModel_.Item_code_ = this.BatchItemViewModelQueueList_[i].ItemCode_; mvm.MessageHeaderViewModel_.MessageId_ = "testID"; mvm.MessageHeaderViewModel_.MessageType_ = "gridCalculation"; mvm.MessageHeaderViewModel_.SendTo_ = "localServer"; mvm.MessageHeaderViewModel_.SentBy_ = "localServer"; mvm.MessageHeaderViewModel_.SequenceNumber_ = "testSerialNum"; GridCalculationViewModel gcvm = new GridCalculationViewModel(); gcvm.mergeSetXml(this.BatchItemViewModelQueueList_[i].Excel_instrumentViewModel_,this.calculationDate_); mvm.MessageBodyViewModel_ = gcvm; //client.StartClient(mvm, localServerInfo_); //messageXmls.Add(mvm.getMessegeStr()); //clients.Add(client); Task taskA = new Task(() => client.StartClient(mvm.getMessegeStr(), localServerInfo_)); taskList.Add(taskA); taskA.Start(); } Task.WaitAll(taskList.ToArray()); } }
public void receive(MessageViewModel msg) { }