Beispiel #1
0
        internal void InvokeEndMethod(ServiceMethodInfo methodInfo, object service, IAsyncResult result, HttpResponse httpResponse)
        {
            ExTraceGlobals.CoreTracer.TraceDebug(0L, "OwaServiceMethodDispatcher.InvokeEndMethod");
            object response = null;

            using (CpuTracker.StartCpuTracking("END"))
            {
                OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate()
                {
                    response = methodInfo.EndMethod.Invoke(service, new object[]
                    {
                        result
                    });
                }, new Func <Exception, bool>(this.CanIgnoreExceptionForWatsonReport));
            }
            if (methodInfo.ShouldAutoDisposeResponse && response != null)
            {
                this.delayedDisposalResponseObject = response;
            }
            this.inspector.BeforeSendReply(httpResponse, methodInfo.Name, response);
            using (CpuTracker.StartCpuTracking("WRITE"))
            {
                OwaServiceMethodDispatcher.WriteResponse(methodInfo, httpResponse, response);
            }
        }
Beispiel #2
0
        private void InternalInvokeMethod(ServiceMethodInfo methodInfo, object service, HttpRequest httpRequest, HttpResponse httpResponse, object[] arguments)
        {
            object request = (arguments != null) ? arguments[0] : null;

            this.inspector.AfterReceiveRequest(httpRequest, methodInfo.Name, request);
            if (methodInfo.ShouldAutoDisposeRequest && arguments != null)
            {
                this.delayedDisposalRequestObjects = arguments;
            }
            object response = null;

            using (CpuTracker.StartCpuTracking("EXEC"))
            {
                OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate()
                {
                    response = this.InvokeSyncMethod(httpRequest, methodInfo, service, arguments);
                }, new Func <Exception, bool>(this.CanIgnoreExceptionForWatsonReport));
            }
            if (methodInfo.ShouldAutoDisposeResponse && response != null)
            {
                this.delayedDisposalResponseObject = response;
            }
            using (CpuTracker.StartCpuTracking("WRITE"))
            {
                OwaServiceMethodDispatcher.WriteResponse(methodInfo, httpResponse, response);
            }
        }
 public void BeforeSendReply(HttpResponse httpResponse, string methodName, object response)
 {
     using (CpuTracker.StartCpuTracking("POST"))
     {
         this.InternalBeforeSendReply();
     }
 }
 public void AfterReceiveRequest(HttpRequest httpRequest, string methodName, object request)
 {
     using (CpuTracker.StartCpuTracking("PRE"))
     {
         this.InternalAfterReceiveRequest(httpRequest, methodName, request);
     }
 }
Beispiel #5
0
        public void BeforeSendReply(ref Message reply, object correlationState)
        {
            HttpContext          httpContext = HttpContext.Current;
            RequestDetailsLogger current     = RequestDetailsLoggerBase <RequestDetailsLogger> .GetCurrent(httpContext);

            RequestDetailsLogger.LogEvent(current, OwaServerLogger.LoggerData.OwaMessageInspectorEndRequestBegin);
            using (CpuTracker.StartCpuTracking("POST"))
            {
                this.InternalBeforeSendReply();
            }
            RequestDetailsLogger.LogEvent(current, OwaServerLogger.LoggerData.OwaMessageInspectorEndRequestEnd);
        }
Beispiel #6
0
        public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
        {
            HttpContext          httpContext = HttpContext.Current;
            RequestDetailsLogger current     = RequestDetailsLoggerBase <RequestDetailsLogger> .GetCurrent(httpContext);

            RequestDetailsLogger.LogEvent(current, OwaServerLogger.LoggerData.OwaMessageInspectorReceiveRequestBegin);
            object result;

            using (CpuTracker.StartCpuTracking("PRE"))
            {
                result = this.InternalAfterReceiveRequest(ref request, current);
            }
            RequestDetailsLogger.LogEvent(current, OwaServerLogger.LoggerData.OwaMessageInspectorReceiveRequestEnd);
            return(result);
        }
Beispiel #7
0
        private IAsyncResult InternalInvokeBeginMethod(ServiceMethodInfo methodInfo, object service, HttpRequest httpRequest, AsyncCallback asyncCallback, object[] arguments)
        {
            int    num     = (arguments != null) ? arguments.Length : 0;
            object request = (num > 0) ? arguments[0] : null;

            this.inspector.AfterReceiveRequest(httpRequest, methodInfo.Name, request);
            if (methodInfo.ShouldAutoDisposeRequest && arguments != null)
            {
                this.delayedDisposalRequestObjects = arguments;
            }
            IAsyncResult result = null;

            using (CpuTracker.StartCpuTracking("BEGIN"))
            {
                object[] invokeArgs = this.ConstructAsyncInvokeArguments(arguments, asyncCallback);
                OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate()
                {
                    result = (IAsyncResult)OwaServiceMethodDispatcher.InvokeMethod(httpRequest, methodInfo.BeginMethod, service, invokeArgs);
                }, new Func <Exception, bool>(this.CanIgnoreExceptionForWatsonReport));
            }
            return(result);
        }
Beispiel #8
0
 public void StartCpuTracking(string agentName)
 {
     this.cpuTracker = CpuTracker.StartCpuTracking(agentName);
 }