예제 #1
0
        public ChaosInvocationResp ProcessInvocation(ChaosInvocation chaosInvocation)
        {
            try
            {
                var realImplementObject = _serviceResolver.GetService(chaosInvocation.InterfaceTypeFullName);
                var realImplementType   = realImplementObject.GetType();
                var realImplementInfo   = ReflectionClass.Reflection(realImplementType);

                var mi = FindMethod(realImplementInfo, chaosInvocation);

                var requestParameters = chaosInvocation.Parameters;
                var args = requestParameters.DeserializeToArguments(_serializer, _typeFinder)
                           .ToArray();

                var returnValue = mi.Func(realImplementObject, args);

                var invocationReply = ToChaosInvocationResp(chaosInvocation, returnValue);
                return(invocationReply);
            }
            catch (Exception ex)
            {
                var invocationReply = ToChaosInvocationResp(chaosInvocation, (object)null);
                invocationReply.Exception = SerializeException.CreateFromException(ex);
                return(invocationReply);
            }
        }
예제 #2
0
 public RemotingException(SerializeException ex)
     : base(ex.Message + Environment.NewLine + ex.StackTrace)
 {
 }