示例#1
0
 ///<summary>触发Transaction创建事件</summary>
 protected void OnTransactionCreated(RpcServerTransaction tx)
 {
     if (TransactionCreated != null)
     {
         TransactionCreated(this, tx);
     }
 }
示例#2
0
 /// <summary>
 ///		安全触发Transaction创建事件
 /// </summary>
 /// <param name="trans"></param>
 protected void OnTransactionCreated(RpcServerTransaction trans)
 {
     if (TransactionCreated != null)
     {
         TransactionCreated(trans);
     }
 }
示例#3
0
        public void ProcessTransaction(RpcServerTransaction tx)
        {
            RpcServerContext context = null;

            try {
                context = new RpcServerContext(tx);

                RpcServiceBase serviceBase;
                _perfCounter.InvokePerSec.Increment();
                _perfCounter.InvokeTotal.Increment();
                _perfCounter.ConcurrentThreads.Increment();
                _perfCounter.ConcurrentContext.Increment();

                if (_services.TryGetValue(context.ServiceName, out serviceBase))
                {
                    serviceBase.OnTransactionStart(context);
                }
                else
                {
                    context.ReturnError(RpcErrorCode.ServiceNotFound, new Exception(context.ServiceName + " NotFound"));
                }
            } catch (RpcException ex) {
                context.ReturnError(ex.RpcCode, ex);
            } catch (Exception ex) {
                context.ReturnError(RpcErrorCode.ServerError, ex);
            } finally {
                _perfCounter.ConcurrentThreads.Decrement();
            }
        }
示例#4
0
 private void TransactionCreated(RpcServerTransaction tx)
 {
     if (BeforeTransactionCreated != null)
     {
         BeforeTransactionCreated(tx);
     }
     _dispatcher.ProcessTransaction(tx);
 }
示例#5
0
 public static void LinkTransaction(RpcServerTransaction tx)
 {
     RpcInprocServerChannel.Instance.OnTransactionCreated(tx);
 }