Package org.quartz

Examples of org.quartz.JobKey


    }

    private void unregisterJob(final String jobName) {
        try {
            scheduler.getScheduler().unscheduleJob(new TriggerKey(jobName, Scheduler.DEFAULT_GROUP));
            scheduler.getScheduler().deleteJob(new JobKey(jobName, Scheduler.DEFAULT_GROUP));
        } catch (SchedulerException e) {
            LOG.error("Could not remove job " + jobName, e);
        }

        if (ApplicationContextProvider.getBeanFactory().containsSingleton(jobName)) {
View Full Code Here


   * @return
   */
  public static JobDetail getJobDetail(Scheduler scheduler, String jobKey) {
    JobDetail jobDetail = null;
    try {
      jobDetail = scheduler.getJobDetail(new JobKey(jobKey));
    } catch (SchedulerException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return jobDetail;
View Full Code Here

    if(!getIsEnabled()){
      throw new FixFlowScheduleException(ExceptionCode.QUARZTEXCEPTION_ISENABLE);
    }
    Scheduler scheduler = getScheduler();
    try {
      scheduler.pauseJob(new JobKey(name,group));
    } catch (SchedulerException e) {
      throw new FixFlowException(e.getMessage(),e);
    }
  }
View Full Code Here

    if(!getIsEnabled()){
      throw new FixFlowScheduleException(ExceptionCode.QUARZTEXCEPTION_ISENABLE);
    }
    Scheduler scheduler = getScheduler();
    try {
      scheduler.resumeJob(new JobKey(name,group));
    } catch (SchedulerException e) {
      throw new FixFlowException(e.getMessage(),e);
    }
  }
View Full Code Here

      throw new FixFlowScheduleException(ExceptionCode.QUARZTEXCEPTION_ISENABLE);
    }
    Scheduler scheduler = getScheduler();
    try{
      @SuppressWarnings("unchecked")
      List<Trigger> triggers = (List<Trigger>) scheduler.getTriggersOfJob(new JobKey(jobName,jobGroup));
      return triggers;
    }catch(Exception e){
      throw new FixFlowException(e.getMessage(),e);
    }
  }
View Full Code Here

    public void execute(JobExecutionContext context)
        throws JobExecutionException {

        // This job simply prints out its job name and the
        // date and time that it is running
        JobKey jobKey = context.getJobDetail().getKey();
        _log.info("SimpleJob says: " + jobKey + " executing at " + new Date() + "我在做事!");
    }
View Full Code Here

    }

    @Override
    public void registerNewJob(Class<? extends Job> jobClass)
    {
        JobKey jobKey = createJobKey(jobClass);

        try
        {
            Scheduled scheduled = jobClass.getAnnotation(Scheduled.class);
View Full Code Here

    @Override
    public boolean isExecutingJob(Class<? extends Job> jobClass)
    {
        try
        {
            JobKey jobKey = createJobKey(jobClass);
            JobDetail jobDetail = this.scheduler.getJobDetail(jobKey);

            if (jobDetail == null)
            {
                return false;
            }

            for (JobExecutionContext jobExecutionContext : this.scheduler.getCurrentlyExecutingJobs())
            {
                if (jobKey.equals(jobExecutionContext.getJobDetail().getKey()))
                {
                    return true;
                }
            }
View Full Code Here

        String groupName = scheduled.group().getSimpleName();
        String jobName = jobClass.getSimpleName();

        if (!Scheduled.class.getSimpleName().equals(groupName))
        {
            return new JobKey(jobName, groupName);
        }
        return new JobKey(jobName);
    }
View Full Code Here

                    break;
                }
               
                // If trigger's job is set as @DisallowConcurrentExecution, and it has already been added to result, then
                // put it back into the timeTriggers set and continue to search for next trigger.
                JobKey jobKey = tw.trigger.getJobKey();
                JobDetail job = jobsByKey.get(tw.trigger.getJobKey()).jobDetail;
                if (job.isConcurrentExectionDisallowed()) {
                    if (acquiredJobKeysForNoConcurrentExec.contains(jobKey)) {
                        excludedTriggers.add(tw);
                        continue; // go to next trigger in store.
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.