Exemplo n.º 1
0
 public Tuple <RemoteResult, SelectSearchResult> SelectQuery(SelectDescription description)
 {
     return(SendFunc <Tuple <RemoteResult, SelectSearchResult>, ICommonNetReceiverWriterForCollector>(
                api => api.SelectQuery(description),
                e => new Tuple <RemoteResult, SelectSearchResult>(new ServerNotAvailable(Server), null),
                NetLogHelper.GetLog(description)));
 }
Exemplo n.º 2
0
 public RemoteResult SendSync(NetCommand command)
 {
     return(SendFunc <RemoteResult, ICommonNetReceiverForDb>(
                api => api.SendSync(command),
                e => new ServerNotAvailable(Server),
                NetLogHelper.GetLog(command)));
 }
Exemplo n.º 3
0
 public RemoteResult ProcessSync(InnerData data)
 {
     return(SendFunc <RemoteResult, ICommonNetReceiverWriterForWrite>(
                api => api.ProcessSync(data),
                e => new ServerNotAvailable(Server),
                NetLogHelper.GetLog(data)));
 }
Exemplo n.º 4
0
 public UserTransaction GetTransaction(UserTransaction transaction)
 {
     return(SendFunc <UserTransaction, ICommonNetReceiverForProxy>(
                api => api.GetTransaction(transaction),
                e => null,
                NetLogHelper.GetLog(transaction)));
 }
Exemplo n.º 5
0
 public RemoteResult TransactionAnswerResult(Transaction transaction)
 {
     return(SendFunc <RemoteResult, ICommonNetReceiverForDb>(
                api =>
     {
         api.TransactionAnswer(transaction);
         return new SuccessResult();
     },
                e => new ServerNotAvailable(Server),
                NetLogHelper.GetLog(transaction)));
 }
Exemplo n.º 6
0
 public RemoteResult SendASyncWithResult(NetCommand command)
 {
     return(SendFunc <RemoteResult, ICommonCommunicationNet>(
                api =>
     {
         api.SendASync(command);
         return new SuccessResult();
     },
                e => new ServerNotAvailable(Server),
                NetLogHelper.GetLog(command)));
 }
Exemplo n.º 7
0
 public RemoteResult RollbackData(InnerData data)
 {
     return(SendFunc <RemoteResult, ICommonNetReceiverWriterForWrite>(
                api =>
     {
         api.Rollback(data);
         return new SuccessResult();
     },
                e => new ServerNotAvailable(Server),
                NetLogHelper.GetLog(data)));
 }
Exemplo n.º 8
0
        public InnerData ReadOperation(InnerData data, out RemoteResult result)
        {
            RemoteResult res = null;
            var          ret = SendFunc <InnerData, ICommonNetReceiverWriterForWrite>(
                api =>
            {
                var r = api.ReadOperation(data);
                res   = new SuccessResult();
                return(r);
            },
                e =>
            {
                res = new ServerNotAvailable(Server);
                return(null);
            },
                NetLogHelper.GetLog(data));

            result = res;
            return(ret);
        }
Exemplo n.º 9
0
        public RemoteResult ProcessData(InnerData data)
        {
            return(SendFunc <RemoteResult, ICommonNetReceiverForProxy>(
                       api =>
            {
                api.Process(data);
                data.Transaction.PerfTimer.Complete();
                PerfCounters.ProxyCounters.Instance.AllProcessPerSec.OperationFinished();

                if (data.Transaction.OperationType == OperationType.Sync)
                {
                    PerfCounters.ProxyCounters.Instance.SyncProcessPerSec.OperationFinished();
                }
                else
                {
                    PerfCounters.ProxyCounters.Instance.AsyncProcessPerSec.OperationFinished();
                }

                return new SuccessResult();
            },
                       e => new ServerNotAvailable(Server),
                       NetLogHelper.GetLog(data)));
        }