internal JasmineContext GetContext(string messageTreeId) { if (Jasmine.IsInitialized(messageTreeId)) { JasmineContext ctx = m_Context[messageTreeId]; if (ctx != null) { return(ctx); } if (m_ClientConfig.DevMode) { throw new Exception( "Cat has not been initialized successfully, please call Cal.setup(...) first for each thread."); } } return(null); }
public void Run(object o) { while (true) { if (!m_nodeInfo.HaveAcessRight) { break; } m_nodeInfo.Refresh(); var messageTreeId = Jasmine.GetManager().GetMessageIdFactory().GetNextId(); ITransaction t = Jasmine.GetProducer().NewTransaction("System", "Status", messageTreeId); IHeartbeat h = Jasmine.GetProducer().NewHeartbeat("Heartbeat", domainInfo.Ip, messageTreeId); var xml = XmlHelper.XmlSerialize(m_nodeInfo, Encoding.UTF8); h.AddData(xml); h.Status = "0"; h.Complete(messageTreeId); t.Status = "0"; t.Complete(messageTreeId); Thread.Sleep(this.domainInfo.TickTime); } }
public Rice CreateRice(string model) { model = model.ToLower(); Rice rice = null; if (model.Equals("basmati")) { rice = new Basmati(); } else if (model.Equals("black")) { rice = new Black(); } else if (model.Equals("brown")) { rice = new Brown(); } else if (model.Equals("jasmine")) { rice = new Jasmine(); } return(rice); }