///<summary>触发Transaction创建事件</summary> protected void OnTransactionCreated(RpcServerTransaction tx) { if (TransactionCreated != null) { TransactionCreated(this, tx); } }
/// <summary> /// 安全触发Transaction创建事件 /// </summary> /// <param name="trans"></param> protected void OnTransactionCreated(RpcServerTransaction trans) { if (TransactionCreated != null) { TransactionCreated(trans); } }
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(); } }
private void TransactionCreated(RpcServerTransaction tx) { if (BeforeTransactionCreated != null) { BeforeTransactionCreated(tx); } _dispatcher.ProcessTransaction(tx); }
public static void LinkTransaction(RpcServerTransaction tx) { RpcInprocServerChannel.Instance.OnTransactionCreated(tx); }