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


      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();
                interuptJob(context.getJobDetail().getName());
            }

            getScheduler().pauseAll();

        } catch (SchedulerException se) {
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public boolean isExecuting() throws SchedulerException {
        for (Iterator i = scheduler.getCurrentlyExecutingJobs().iterator(); i.hasNext();) {
            JobExecutionContext context = (JobExecutionContext) i.next();
            if (context.getJobDetail().getFullName().equals(jobDetail.getFullName())) {
                return true;
            }
        }
        return false;
    }
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

      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 boolean isExecuting() throws SchedulerException {
        for (Iterator i = scheduler.getCurrentlyExecutingJobs().iterator(); i.hasNext();) {
            JobExecutionContext context = (JobExecutionContext) i.next();
            if (context.getJobDetail().getFullName().equals(jobDetail.getFullName())) {
                return true;
            }
        }
        return false;
    }
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

      (ExecutionScheduleManager.class);
    BatchRequestJob batchRequestJobMock = createMockBuilder
      (BatchRequestJob.class).withConstructor(scheduleManagerMock, 100L)
      .addMockedMethods("doWork")
      .createMock();
    JobExecutionContext executionContext = createNiceMock(JobExecutionContext.class);
    JobDataMap jobDataMap = createNiceMock(JobDataMap.class);
    JobDetail jobDetail = createNiceMock(JobDetail.class);
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put(BatchRequestJob.BATCH_REQUEST_FAILED_TASKS_KEY, 10);
    properties.put(BatchRequestJob.BATCH_REQUEST_TOTAL_TASKS_KEY, 20);

    expect(scheduleManagerMock.continueOnMisfire(executionContext)).andReturn(true);
    expect(executionContext.getMergedJobDataMap()).andReturn(jobDataMap);
    expect(executionContext.getJobDetail()).andReturn(jobDetail);
    expect(jobDetail.getKey()).andReturn(JobKey.jobKey("testJob", "testGroup"));
    expect(jobDataMap.getWrappedMap()).andReturn(properties);
    expect(jobDataMap.getString((String) anyObject())).andReturn("testJob").anyTimes();

    Capture<Trigger> triggerCapture = new Capture<Trigger>();
View Full Code Here

    AbstractLinearExecutionJob executionJob =
      createMockBuilder(AbstractLinearExecutionJob.class)
      .addMockedMethods("finalizeExecution", "doWork")
      .withConstructor(scheduleManagerMock)
      .createMock();
    JobExecutionContext context = createMock(JobExecutionContext.class);
    JobDetail jobDetail = createMock(JobDetail.class);
    JobDataMap jobDataMap = createMock(JobDataMap.class);

    expect(context.getJobDetail()).andReturn(jobDetail).anyTimes();
    expect(context.getMergedJobDataMap()).andReturn(jobDataMap).anyTimes();
    expect(jobDetail.getKey()).andReturn(new JobKey("TestJob"));
    expect(jobDataMap.getWrappedMap()).andReturn(new HashMap<String,Object>());
    expect(scheduleManagerMock.continueOnMisfire(context)).andReturn(true);

    executionJob.doWork((Map<String, Object>) anyObject());
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.