Package org.quartz

Examples of org.quartz.JobExecutionContext


      try
      {
         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


                final Trigger trigger = new SimpleTrigger(name, DEFAULT_QUARTZ_JOB_GROUP);

                TriggerFiredBundle fireBundle = new TriggerFiredBundle(detail, trigger, null, false, null, null, null, null);

                final Job executor = createJobExecutor();
                final JobExecutionContext context = new JobExecutionContext(this.scheduler, fireBundle, executor);

                this.executor.execute(new Runnable() {
                        public void run() {
                            try {
                                executor.execute(context);
View Full Code Here

                    "An error occured instantiating job to be executed. job= '"
                            + jobDetail.getFullName() + "'", se);
            throw se;
        }

        this.jec = new JobExecutionContext(scheduler, firedBundle, job);
    }
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();
            jobDetail = jec.getJobDetail();
            if (jobName.equals(jobDetail.getName())
                && groupName.equals(jobDetail.getGroup())){
                job = jec.getJobInstance();
                if (job instanceof InterruptableJob) {
                    ((InterruptableJob)job).interrupt();
                    interrupted = true;
                } else {
                    throw new UnableToInterruptJobException(
View Full Code Here

      try
      {
         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

                final JobDetail detail = createJobDetail(name, jobDataMap);

                TriggerFiredBundle trigger = new TriggerFiredBundle(detail, null, null, false, null, null, null, null);

                final Job executor = createJobExecutor();
                final JobExecutionContext context = new JobExecutionContext(this.scheduler, trigger, executor);

                this.executor.execute(new Runnable() {
                        public void run() {
                            // ((CronJob)job).execute(name);
                            try {
View Full Code Here

                final JobDetail detail = createJobDetail(name, jobDataMap);

                TriggerFiredBundle trigger = new TriggerFiredBundle(detail, null, null, false, null, null, null, null);

                final Job executor = createJobExecutor();
                final JobExecutionContext context = new JobExecutionContext(this.scheduler, trigger, executor);

                this.executor.execute(new Runnable() {
                        public void run() {
                            // ((CronJob)job).execute(name);
                            try {
View Full Code Here

                final Trigger trigger = new SimpleTrigger(name, DEFAULT_QUARTZ_JOB_GROUP);

                TriggerFiredBundle fireBundle = new TriggerFiredBundle(detail, trigger, null, false, null, null, null, null);

                final Job executor = createJobExecutor();
                final JobExecutionContext context = new JobExecutionContext(this.scheduler, fireBundle, executor);

                this.executor.execute(new Runnable() {
                        public void run() {
                            try {
                                executor.execute(context);
View Full Code Here

      try
      {
         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

     */
    @SuppressWarnings("unchecked")
    public void pauseAll() {
        try {
            for (Iterator i = scheduler.getCurrentlyExecutingJobs().iterator(); i.hasNext();) {
                JobExecutionContext context = (JobExecutionContext) i.next();
                interruptJob(context.getJobDetail().getName());
            }

            getScheduler().pauseAll();

        } catch (SchedulerException se) {
View Full Code Here

TOP

Related Classes of org.quartz.JobExecutionContext

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.