HostJobWorkerRequest will be our request into the web appdomain
Inheritance: System.Web.Hosting.SimpleWorkerRequest
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 private static void WriteResultMessage(HostedJobWorkerRequest wr)
 {
     wr.Job.Context.GetResult(true).ToString().PrintToContext();
     "\nJobFinished\n".PrintToContext();
 }
Exemplo n.º 5
0
 GetWorkerRequest(this HttpContext context)
 {
     return
         (HostedJobWorkerRequest.GetWorkerRequest(context));
 }
Exemplo n.º 6
0
 private static void WriteResultMessage(HostedJobWorkerRequest wr)
 {
     wr.Job.Context.GetResult(true).ToString().PrintToContext();
     "\nJobFinished\n".PrintToContext();
 }