Package org.quartz

Examples of org.quartz.JobKey


  protected void addOrModifyJobs(final NSArray<? extends ERQSJobDescription> jobs2Check)
  {
    setResultMessage("# of jobs to add or modify: " + jobs2Check.size());
    for (ERQSJobDescription aJob2Check : jobs2Check)
    {
      JobKey aJobKey = getJobKeyForJobDescription(aJob2Check);
      try
      {
        JobDetail aJobDetail = getScheduler().getJobDetail(aJobKey);
        if (log.isDebugEnabled())
          log.debug("method: jobs2AddOrModify: aJobKey: " + aJobKey + " /aJobDetail in scheduler: " + aJobDetail);
View Full Code Here


    }
  }

  public JobKey getJobKeyForJobDescription(final ERQSJobDescription aJobDescription)
  {
    return new JobKey(aJobDescription.name(), buildGroup(aJobDescription.group()));
  }
View Full Code Here

    ERQSJobDescription4Test jd = new ERQSJobDescription4Test();
    jd.setClassPath("er.quartzscheduler.foundation.ERQSExtendedAbstractJob4Test");
    jd.setCronExpression("0 0 12 * * ?");
    jd.setIsEnterpriseObject(false);
    js.addJob2Scheduler(jd);
    JobKey aJobKey = new JobKey(ERQSJobDescription4Test.DEF_JOB_NAME,  ERQSJobSupervisor.GROUP_NAME_PREFIX + ERQSJobDescription4Test.DEF_GROUP_NAME);
    JobDetail job = fp.getScheduler().getJobDetail(aJobKey);
    assertNotNull(job);
   
    Set<JobKey> aSet = js.getScheduledJobKeys();
    assertTrue(aSet.size() == 1);
View Full Code Here

    NSArray<ERQSJobDescription> jds = new NSArray<ERQSJobDescription>(new ERQSJobDescription4Test[] {jd1, jd2});
    js.addOrModifyJobs(jds);
    Set<JobKey> aSet = js.getScheduledJobKeys();
    assertTrue(aSet.size() == 2);
    jd2.setCronExpression("0 0 6 * * ?");
    JobKey jobKey4jd2 = js.getJobKeyForJobDescription(jd2);
 
    JobDetail job4jd2 = fp.getScheduler().getJobDetail(jobKey4jd2);
    js.modifyJob(jd2, job4jd2);
    List<? extends Trigger> triggers = fp.getScheduler().getTriggersOfJob(jobKey4jd2);
    assertNotNull(triggers);
View Full Code Here

  @Test
  public void testInstantiateJobSupervisor() throws SchedulerException
  {
    ERQSSchedulerFP4Test fp = new ERQSSchedulerFP4Test();
    fp.instantiateJobSupervisor();
    JobDetail supervisor = fp.getScheduler().getJobDetail(new JobKey("JobSupervisor", Scheduler.DEFAULT_GROUP));
    assertNotNull(supervisor);
    assertEquals(supervisor.getJobClass(), ERQSJobSupervisor.class);
    fp.stopScheduler();
  }
View Full Code Here

        this.plugin.log(Level.FINER, "A new MVAdventureWorld-Object was created!");
    }

    private void initCronScheduler() {
        if (quartzJobKey == null) {
            quartzJobKey = new JobKey(getName() + "-reset", "resets");
        }
        // Cancel previous job if exists.
        try {
            if (plugin.getQuartzScheduler().deleteJob(quartzJobKey)) {
                plugin.log(Level.FINE, "Deleted previous cron job for " + getName());
View Full Code Here

    return new DefaultJobProvider().getJobWrapper(options);

  }

  public void unschedule(String id) {
    JobKey jobKey = new JobKey(id);
    try {
      if (quartz.checkExists(jobKey)) {
        quartz.deleteJob(jobKey);
      }
    } catch (SchedulerException e) {
View Full Code Here

    }
  }

  public TaskScheduler include(String param, Object value, String taskId) {
    try {
      JobDetail detail = quartz.getJobDetail(new JobKey(taskId));
      if (detail != null) {
        detail.getJobDataMap().put(param, value);
        quartz.addJob(detail, true);
      }
    } catch (SchedulerException e) {
View Full Code Here

    }
    return this;
  }

  private boolean alreadyExists(String id) throws SchedulerException {
    return quartz.checkExists(new JobKey(id));
  }
View Full Code Here

  @Override
  public void triggerNow(Class<? extends Job> jobClass) {
    try {
      String key = jobClass.getName();
      JobKey jobKey = new JobKey(key);
      scheduler.triggerJob(jobKey);
    } catch (SchedulerException e) {

    }
  }
View Full Code Here

TOP

Related Classes of org.quartz.JobKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.