Package org.quartz

Examples of org.quartz.Job


/* 165 */     Trigger trigger = this.jec.getTrigger();
/* 166 */     JobDetail jobDetail = this.jec.getJobDetail();
/*     */     while (true)
/*     */     {
/* 170 */       JobExecutionException jobExEx = null;
/* 171 */       Job job = this.jec.getJobInstance();
/*     */       try
/*     */       {
/* 174 */         begin();
/*     */       } catch (SchedulerException se) {
/* 176 */         this.qs.notifySchedulerListenersError("Error executing Job (" + this.jec.getJobDetail().getFullName() + ": couldn't begin execution.", se);
/*     */
/* 179 */         break;
/*     */       }
/*     */
/*     */       try
/*     */       {
/* 184 */         if (!notifyListenersBeginning(this.jec)) break;
/*     */       }
/*     */       catch (VetoedException ve)
/*     */       {
/*     */         try {
/* 188 */           complete(true);
/*     */         } catch (SchedulerException se) {
/* 190 */           this.qs.notifySchedulerListenersError("Error during veto of Job (" + this.jec.getJobDetail().getFullName() + ": couldn't finalize execution.", se);
/*     */         }
/*     */
/* 194 */         break;
/*     */       }
/*     */
/* 197 */       long startTime = System.currentTimeMillis();
/* 198 */       long endTime = startTime;
/*     */       try
/*     */       {
/* 202 */         this.log.debug("Calling execute on job " + jobDetail.getFullName());
/* 203 */         job.execute(this.jec);
/* 204 */         endTime = System.currentTimeMillis();
/*     */       } catch (JobExecutionException jee) {
/* 206 */         endTime = System.currentTimeMillis();
/* 207 */         jobExEx = jee;
/* 208 */         getLog().info("Job " + jobDetail.getFullName() + " threw a JobExecutionException: ", jobExEx);
View Full Code Here


/* 1873 */     List jobs = getCurrentlyExecutingJobs();
/* 1874 */     Iterator it = jobs.iterator();
/*      */
/* 1876 */     JobExecutionContext jec = null;
/* 1877 */     JobDetail jobDetail = null;
/* 1878 */     Job job = null;
/*      */
/* 1880 */     boolean interrupted = false;
/*      */
/* 1882 */     while (it.hasNext()) {
/* 1883 */       jec = (JobExecutionContext)it.next();
View Full Code Here

/*  53 */   private boolean warnIfNotFound = true;
/*  54 */   private boolean throwIfNotFound = false;
/*     */
/*     */   public Job newJob(TriggerFiredBundle bundle) throws SchedulerException
/*     */   {
/*  58 */     Job job = super.newJob(bundle);
/*     */
/*  60 */     JobDataMap jobDataMap = new JobDataMap();
/*  61 */     jobDataMap.putAll(bundle.getJobDetail().getJobDataMap());
/*  62 */     jobDataMap.putAll(bundle.getTrigger().getJobDataMap());
/*     */
View Full Code Here

    private boolean warnIfNotFound = true;
    private boolean throwIfNotFound = false;
   
    public Job newJob(TriggerFiredBundle bundle) throws SchedulerException {

        Job job = super.newJob(bundle);
       
        JobDataMap jobDataMap = new JobDataMap();
        jobDataMap.putAll(bundle.getJobDetail().getJobDataMap());
        jobDataMap.putAll(bundle.getTrigger().getJobDataMap());
View Full Code Here

        List jobs = getCurrentlyExecutingJobs();
        java.util.Iterator it = jobs.iterator();
       
        JobExecutionContext jec = null;
        JobDetail jobDetail = null;
        Job job = null;
       
        boolean interrupted = false;
       
        while (it.hasNext()) {
            jec = (JobExecutionContext)it.next();
View Full Code Here

   
    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 {
                        int instCode = trigger.executionComplete(jec, null);
                        try {
                            qs.notifyJobStoreJobVetoed(schdCtxt, trigger, jobDetail, instCode);
                        } catch(JobPersistenceException jpe) {
                            vetoedJobRetryLoop(trigger, jobDetail, instCode);
                        }
                        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

    private boolean warnIfNotFound = true;
    private boolean throwIfNotFound = false;
   
    public Job newJob(TriggerFiredBundle bundle) throws SchedulerException {

        Job job = super.newJob(bundle);
       
        JobDataMap jobDataMap = new JobDataMap();
        jobDataMap.putAll(bundle.getJobDetail().getJobDataMap());
        jobDataMap.putAll(bundle.getTrigger().getJobDataMap());
View Full Code Here

    private boolean warnIfNotFound = true;
    private boolean throwIfNotFound = false;
   
    public Job newJob(TriggerFiredBundle bundle) throws SchedulerException {

        Job job = super.newJob(bundle);
       
        JobDataMap jobDataMap = new JobDataMap();
        jobDataMap.putAll(bundle.getJobDetail().getJobDataMap());
        jobDataMap.putAll(bundle.getTrigger().getJobDataMap());
View Full Code Here

        List jobs = getCurrentlyExecutingJobs();
        java.util.Iterator it = jobs.iterator();
       
        JobExecutionContext jec = null;
        JobDetail jobDetail = null;
        Job job = null;
       
        boolean interrupted = false;
       
        while (it.hasNext()) {
            jec = (JobExecutionContext)it.next();
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.