Package org.quartz

Examples of org.quartz.Job


   
    public void initialize(QuartzScheduler qs, TriggerFiredBundle firedBundle)
            throws SchedulerException {
        this.qs = qs;

        Job job = null;
        JobDetail jobDetail = firedBundle.getJobDetail();

        try {
            job = qs.getJobFactory().newJob(firedBundle);
        } catch (SchedulerException se) {
View Full Code Here


        JobDetail jobDetail = jec.getJobDetail();

        do {

            JobExecutionException jobExEx = null;
            Job job = jec.getJobInstance();

            try {
                begin();
            } catch (SchedulerException se) {
                qs.notifySchedulerListenersError("Error executing Job ("
                        + jec.getJobDetail().getFullName()
                        + ": couldn't begin execution.", se);
                break;
            }

            // notify job & trigger listeners...
            try {
                if (!notifyListenersBeginning(jec)) break;
            }
            catch(VetoedException ve) {
                try {
                    complete(true);
                } catch (SchedulerException se) {
                    qs.notifySchedulerListenersError("Error during veto of Job ("
                            + jec.getJobDetail().getFullName()
                            + ": couldn't finalize execution.", se);
                }
                break;
            }

            long startTime = System.currentTimeMillis();
            long endTime = startTime;
           
            // execute the job
            try {
                log.debug("Calling execute on job " + jobDetail.getFullName());
                job.execute(jec);
                endTime = System.currentTimeMillis();
            } catch (JobExecutionException jee) {
                endTime = System.currentTimeMillis();
                jobExEx = jee;
                getLog().info("Job " + jobDetail.getFullName() +
View Full Code Here

            .withSchedule(cronSchedule(crontab))
            .build();

        TriggerFiredBundle tfb = new TriggerFiredBundle(jd, (OperableTrigger) trigger, null,
            false, null, null, null, null);
        Job j = hf.newJob(tfb, null);
        assertNotNull(j);
    }
View Full Code Here

    @Override
    public Job newJob(TriggerFiredBundle bundle, Scheduler scheduler)
        throws SchedulerException {
        final Class<? extends Job> jobClass = bundle.getJobDetail().getJobClass();
        Job decorator = new JobScopeDecorator(jobClass);
        return decorator;
    }
View Full Code Here

      {
         List jobs = getAllExcutingJobs();
         for (Object object : jobs)
         {
            JobExecutionContext ctx = (JobExecutionContext)object;
            Job job = ctx.getJobInstance();
            if (job instanceof InterruptableJob)
            {
               ((InterruptableJob)job).interrupt();
            }
         }
View Full Code Here

      try
      {
         List<JobExecutionContext> jobs = getAllExcutingJobs();
         for (JobExecutionContext ctx : jobs)
         {
            Job job = ctx.getJobInstance();
            if (job instanceof InterruptableJob)
            {
               ((InterruptableJob)job).interrupt();
            }
         }
View Full Code Here

    } catch (Exception e)
    {
      throw new COJobInstanciationException("Class " + jobDescription.classPath() + " not found.", ErrorType.CONSTRUCTOR_ERROR, e);
    }

    Job aJob = null;
    try
    {
      aJob = constructor.newInstance();
    } catch (Exception e)
    {
View Full Code Here

    return aJob;
  }

  public static Job willDelete(final ERQSJobDescription jobDescription) throws COJobInstanciationException
  {
    Job aJob = createJobInstance(jobDescription);
    if (aJob instanceof ERQSJob)
      ((ERQSJob)aJob).willDelete(jobDescription);
    return aJob;
  }
View Full Code Here

    return aJob;
  }

  public static Job willSave(final ERQSJobDescription jobDescription) throws COJobInstanciationException
  {
    Job aJob = createJobInstance(jobDescription);
    if (aJob instanceof ERQSJob)
      ((ERQSJob)aJob).willSave(jobDescription);
    return aJob;
  }
View Full Code Here

    return aJob;
  }

  public static Job validateForDelete(final ERQSJobDescription jobDescription) throws COJobInstanciationException
  {
    Job aJob = createJobInstance(jobDescription);
    if (aJob instanceof ERQSJob)
      ((ERQSJob)aJob).validateForDelete(jobDescription);
    return aJob;
  }
View Full Code Here

TOP

Related Classes of org.quartz.Job

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.