HostJobWorkerRequest will be our request into the web appdomain
상속: System.Web.Hosting.SimpleWorkerRequest
예제 #1
0
        private void AuthenticateRequest(HostedJobWorkerRequest wr)
        {
            if (AuthenticationAction == null) return;
            if (wr == null) return;
            if (wr.Job == null) return;

            if ( !string.IsNullOrEmpty(wr.Job.UserName))
            {
                AuthenticationAction(wr.Job.Domain, wr.Job.UserName);
            }
        }
예제 #2
0
        private void AuthenticateRequest(HostedJobWorkerRequest wr)
        {
            if (AuthenticationAction == null)
            {
                return;
            }
            if (wr == null)
            {
                return;
            }
            if (wr.Job == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(wr.Job.UserName))
            {
                AuthenticationAction(wr.Job.Domain, wr.Job.UserName);
            }
        }
예제 #3
0
        public void ProcessRequest(HttpContext context)
        {
            HostedJobWorkerRequest workerRequest = context.GetWorkerRequest();

            if (workerRequest == null)
            {
                throw new InvalidOperationException("HostedJobWorkerRequest is null");
            }
            if (workerRequest.Job == null || workerRequest.Job.JobManager == null)
            {
                throw new InvalidOperationException("Job or JobManager is null");
            }

            var jobManager = workerRequest.Job.JobManager;

            AuthenticateRequest(workerRequest);
            WriteStartMessage(context);
            jobManager.StartJob(workerRequest.Job);

            WriteResultMessage(workerRequest);
        }
예제 #4
0
 private static void WriteResultMessage(HostedJobWorkerRequest wr)
 {
     wr.Job.Context.GetResult(true).ToString().PrintToContext();
     "\nJobFinished\n".PrintToContext();
 }
예제 #5
0
 GetWorkerRequest(this HttpContext context)
 {
     return
         (HostedJobWorkerRequest.GetWorkerRequest(context));
 }
예제 #6
0
 private static void WriteResultMessage(HostedJobWorkerRequest wr)
 {
     wr.Job.Context.GetResult(true).ToString().PrintToContext();
     "\nJobFinished\n".PrintToContext();
 }