private object CreateInstance(JobActivatorScope scope, ActivationContext context) { var filterInfo = new JobFilterInfo(_filterProvider.GetFilters(context.BackgroundJob.Job)); BeforeActivation(context, filterInfo.ActivationFilters); var activatedContext = ActivateJob(scope, context); AfterActivation(activatedContext, filterInfo.ActivationFilters); if (activatedContext.Exception != null) { throw activatedContext.Exception; } if (activatedContext.Instance == null) { throw new InvalidOperationException( String.Format("JobActivator returned NULL instance of the '{0}' type.", context.BackgroundJob.Job.Type)); } return(activatedContext.Instance); }
private JobFilterInfo GetFilters(Job job) { return(new JobFilterInfo(_filterProvider.GetFilters(job))); }