Пример #1
0
        public void  ListFailedTransactions(RpcServerContext ctx)
        {
            if (_coordinator == null)
            {
                throw new Exception("Coordinator is Null");
            }
            string transName = ctx.GetArgs <string>();

            if (transName != _coordinator.TransName)
            {
                throw new Exception("TransName not Matched");
            }
            List <TccTransactionData>    dataList = (List <TccTransactionData>)_coordinator.GetFailedTransactions();
            RpcList <TccTransactionData> rpcList  = null;

            if (dataList != null && dataList.Count > 0)
            {
                rpcList = new RpcList <TccTransactionData>();
                foreach (TccTransactionData data in dataList)
                {
                    rpcList.Value.Add(data);
                }
            }
            ctx.Return <RpcList <TccTransactionData> >(rpcList);
        }
Пример #2
0
        public void AppendSystemLog(RpcServerContext context)
        {
            RpcList <SystemLogEvent> evts = context.GetArgs <RpcList <SystemLogEvent> >();

            foreach (SystemLogEvent evt in evts.Value)
            {
                Console.WriteLine(evt.ToString());
            }
            WaitEvent.Set();
            context.Return();
        }