示例#1
0
 internal Response(Response other)
 {
     exception = other.exception;
     result = other.result;
 }
示例#2
0
		internal Response Excute(Request request)
		{
			var response = new Response { Id = request.Id };
			var methodDescriptionBuilder = request.RequestDescription;
			IExecutor executor = null;
			servicesLock.EnterReadLock();
			try
			{
				methodMaps.TryGetValue(methodDescriptionBuilder, out executor);
			}
			finally
			{
				servicesLock.ExitReadLock();
			}
			if (executor == null)
			{
				response.ResultException = new MethodNotFoundException(request.ServiceName, request.ReceiverMethod);
				return response;
			}
			try
			{
				response.Result = executor.Execute(request.Parameters);
			}
			catch (Exception e)
			{
                executorLog.WriteLog("Exception when invoke type : " + executor.GetType().FullName + ", with exception: " + e);
				response.ResultException = new MethodInvokingException(executor.GetType().FullName, request.ReceiverMethod, e);
				return response;
			}
			return response;
		}