本文整理汇总了C#中IJobDetail类的典型用法代码示例。如果您正苦于以下问题:C# IJobDetail类的具体用法?C# IJobDetail怎么用?C# IJobDetail使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IJobDetail类属于命名空间,在下文中一共展示了IJobDetail类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: JobAdded
public void JobAdded(IJobDetail jobDetail)
{
foreach (ISchedulerListener listener in listeners)
{
listener.JobAdded(jobDetail);
}
}
示例2: AssignDataMap
void AssignDataMap(IJobDetail jobDetail, object createObject) {
if (jobDetail.JobDataMap!= null) {
var typeInfo = TypesInfo.FindTypeInfo(createObject.GetType());
var jobDataMap = ((JobDataMap) jobDetail.JobDataMap);
jobDataMap.Keys.OfType<string>().Each(AssignValue(createObject, jobDataMap, typeInfo));
}
}
示例3: ScheduleJob
public static void ScheduleJob(this IScheduler scheduler, IJobDetail jobDetail, string scheduleText, TimeZoneInfo timeZone)
{
TextToScheduleFactory factory = new TextToScheduleFactory();
var english = factory.CreateEnglishParser();
var results = english.Parse(scheduleText, timeZone);
results.ScheduleWithJob(scheduler, jobDetail);
}
示例4: JsonJob
public JsonJob(IJobDetail jobDetail, IList<ITrigger> triggers)
{
JobType = jobDetail.JobType.FullName;
Description = jobDetail.Description;
Triggers = new List<JsonTrigger>(triggers.Count);
foreach (var trigger in triggers)
{
Triggers.Add(new JsonTrigger(trigger));
}
}
示例5: JobDetailDto
public JobDetailDto(IJobDetail jobDetail)
{
Durable = jobDetail.Durable;
ConcurrentExecutionDisallowed = jobDetail.ConcurrentExecutionDisallowed;
Description = jobDetail.Description;
JobType = jobDetail.JobType.AssemblyQualifiedNameWithoutVersion();
Name = jobDetail.Key.Name;
Group = jobDetail.Key.Group;
PersistJobDataAfterExecution = jobDetail.PersistJobDataAfterExecution;
RequestsRecovery = jobDetail.RequestsRecovery;
}
示例6: CreateJob
private static void CreateJob()
{
// The job builder uses a fluent interface to
// make it easier to build and generate an
// IJobDetail object
_pollingJobDetail = JobBuilder.Create<PollWebsiteJob>()
.WithIdentity("StartPolling") // Here we can assign a friendly name to our job
.Build(); // And now we build the job detail
// Put options into data map
_pollingJobDetail.JobDataMap.Put("Url", _options.Url);
}
示例7: InsertExtendedTriggerProperties
public int InsertExtendedTriggerProperties(ConnectionAndTransactionHolder conn, IOperableTrigger trigger, string state, IJobDetail jobDetail)
{
ICronTrigger cronTrigger = (ICronTrigger) trigger;
using (IDbCommand cmd = DbAccessor.PrepareCommand(conn, AdoJobStoreUtil.ReplaceTablePrefix(StdAdoConstants.SqlInsertCronTrigger, TablePrefix, SchedNameLiteral)))
{
DbAccessor.AddCommandParameter(cmd, "triggerName", trigger.Key.Name);
DbAccessor.AddCommandParameter(cmd, "triggerGroup", trigger.Key.Group);
DbAccessor.AddCommandParameter(cmd, "triggerCronExpression", cronTrigger.CronExpressionString);
DbAccessor.AddCommandParameter(cmd, "triggerTimeZone", cronTrigger.TimeZone.Id);
return cmd.ExecuteNonQuery();
}
}
示例8: TriggerFiredBundle
/// <summary>
/// Initializes a new instance of the <see cref="TriggerFiredBundle"/> class.
/// </summary>
/// <param name="job">The job.</param>
/// <param name="trigger">The trigger.</param>
/// <param name="cal">The calendar.</param>
/// <param name="jobIsRecovering">if set to <c>true</c> [job is recovering].</param>
/// <param name="fireTimeUtc">The fire time.</param>
/// <param name="scheduledFireTimeUtc">The scheduled fire time.</param>
/// <param name="prevFireTimeUtc">The previous fire time.</param>
/// <param name="nextFireTimeUtc">The next fire time.</param>
public TriggerFiredBundle(IJobDetail job, IOperableTrigger trigger, ICalendar cal, bool jobIsRecovering,
DateTimeOffset? fireTimeUtc,
DateTimeOffset? scheduledFireTimeUtc,
DateTimeOffset? prevFireTimeUtc,
DateTimeOffset? nextFireTimeUtc)
{
this.job = job;
this.trigger = trigger;
this.cal = cal;
this.jobIsRecovering = jobIsRecovering;
this.fireTimeUtc = fireTimeUtc;
this.scheduledFireTimeUtc = scheduledFireTimeUtc;
this.prevFireTimeUtc = prevFireTimeUtc;
this.nextFireTimeUtc = nextFireTimeUtc;
}
示例9: InsertExtendedTriggerProperties
public int InsertExtendedTriggerProperties(ConnectionAndTransactionHolder conn, IOperableTrigger trigger, string state, IJobDetail jobDetail)
{
ISimpleTrigger simpleTrigger = (ISimpleTrigger) trigger;
using (IDbCommand cmd = commandAccessor.PrepareCommand(conn, AdoJobStoreUtil.ReplaceTablePrefix(StdAdoConstants.SqlInsertSimpleTrigger, tablePrefix, schedNameLiteral)))
{
commandAccessor.AddCommandParameter(cmd, "triggerName", trigger.Key.Name);
commandAccessor.AddCommandParameter(cmd, "triggerGroup", trigger.Key.Group);
commandAccessor.AddCommandParameter(cmd, "triggerRepeatCount", simpleTrigger.RepeatCount);
commandAccessor.AddCommandParameter(cmd, "triggerRepeatInterval", simpleTrigger.RepeatInterval.TotalMilliseconds);
commandAccessor.AddCommandParameter(cmd, "triggerTimesTriggered", simpleTrigger.TimesTriggered);
return cmd.ExecuteNonQuery();
}
}
示例10: StoreJobAndTrigger
/// <summary>
/// Store the given <see cref="IJobDetail" /> and <see cref="ITrigger" />.
/// </summary>
/// <param name="newJob">The <see cref="IJobDetail" /> to be stored.</param>
/// <param name="newTrigger">The <see cref="ITrigger" /> to be stored.</param>
public virtual void StoreJobAndTrigger(IJobDetail newJob, IOperableTrigger newTrigger)
{
StoreJob(newJob, false);
StoreTrigger(newTrigger, false);
}
示例11: StoreJob
/// <summary>
/// Store the given <see cref="IJob" />.
/// </summary>
/// <param name="newJob">The <see cref="IJob" /> to be stored.</param>
/// <param name="replaceExisting">If <see langword="true" />, any <see cref="IJob" /> existing in the
/// <see cref="IJobStore" /> with the same name and group should be
/// over-written.</param>
public virtual void StoreJob(IJobDetail newJob, bool replaceExisting)
{
bool repl = false;
lock (lockObject)
{
if (this.CheckExists(newJob.Key))
{
if (!replaceExisting)
{
throw new ObjectAlreadyExistsException(newJob);
}
repl = true;
}
if (!repl)
{
// try insert new
this.Jobs.Insert(newJob.ToBsonDocument());
}
else
{
// force upsert
this.Jobs.Save(newJob.ToBsonDocument());
}
}
}
示例12: JobAdded
public void JobAdded(IJobDetail jobDetail)
{
}
示例13: ScheduleJob
/// <summary>
/// Calls the equivalent method on the 'proxied' <see cref="QuartzScheduler" />.
/// </summary>
public virtual DateTimeOffset ScheduleJob(IJobDetail jobDetail, ITrigger trigger)
{
try
{
return GetRemoteScheduler().ScheduleJob(jobDetail, trigger);
}
catch (RemotingException re)
{
throw InvalidateHandleCreateException("Error communicating with remote scheduler.", re);
}
}
示例14: AddJob
/// <summary>
/// Calls the equivalent method on the 'proxied' <see cref="QuartzScheduler" />.
/// </summary>
public virtual void AddJob(IJobDetail jobDetail, bool replace)
{
try
{
GetRemoteScheduler().AddJob(jobDetail, replace);
}
catch (RemotingException re)
{
throw InvalidateHandleCreateException("Error communicating with remote scheduler.", re);
}
}
示例15: ObjectAlreadyExistsException
/// <summary> <para>
/// Create a <see cref="ObjectAlreadyExistsException" /> and auto-generate a
/// message using the name/group from the given <see cref="IJobDetail" />.
/// </para>
///
/// <para>
/// The message will read: <br />"Unable to store Job with name: '__' and
/// group: '__', because one already exists with this identification."
/// </para>
/// </summary>
public ObjectAlreadyExistsException(IJobDetail offendingJob)
: base($"Unable to store Job: '{offendingJob.Key}', because one already exists with this identification.")
{
}