public SetPropertyValues ( IPropertyValues pvs ) : void | ||
pvs | IPropertyValues |
/// The |
Результат | void |
/// <summary> /// This implementation applies the passed-in job data map as object property /// values, and delegates to <code>ExecuteInternal</code> afterwards. /// </summary> /// <seealso cref="ExecuteInternal" /> public void Execute(IJobExecutionContext context) { try { ObjectWrapper bw = new ObjectWrapper(this); MutablePropertyValues pvs = new MutablePropertyValues(); pvs.AddAll(context.Scheduler.Context); pvs.AddAll(context.MergedJobDataMap); bw.SetPropertyValues(pvs, true); } catch (SchedulerException ex) { throw new JobExecutionException(ex); } ExecuteInternal(context); }
/// <summary> /// Create the job instance, populating it with property values taken /// from the scheduler context, job data map and trigger data map. /// </summary> protected override object CreateJobInstance(TriggerFiredBundle bundle) { ObjectWrapper ow = new ObjectWrapper(bundle.JobDetail.JobType); if (IsEligibleForPropertyPopulation(ow.WrappedInstance)) { MutablePropertyValues pvs = new MutablePropertyValues(); if (schedulerContext != null) { pvs.AddAll(schedulerContext); } pvs.AddAll(bundle.JobDetail.JobDataMap); pvs.AddAll(bundle.Trigger.JobDataMap); if (ignoredUnknownProperties != null) { for (int i = 0; i < ignoredUnknownProperties.Length; i++) { string propName = ignoredUnknownProperties[i]; if (pvs.Contains(propName)) { pvs.Remove(propName); } } ow.SetPropertyValues(pvs); } else { ow.SetPropertyValues(pvs, true); } } return ow.WrappedInstance; }