Package org.quartz

Examples of org.quartz.JobKey


    boolean markCompleted = false;

    if (firstBatchRequest != null) {
      String jobName = getJobName(executionId, firstBatchRequest.getOrderId());
      JobKey jobKey = JobKey.jobKey(jobName, ExecutionJob.LINEAR_EXECUTION_JOB_GROUP);
      JobDetail jobDetail;
      try {
        jobDetail = executionScheduler.getJobDetail(jobKey);
      } catch (SchedulerException e) {
        LOG.warn("Unable to retrieve job details from scheduler. job: " + jobKey);
View Full Code Here


   * @param context
   * @throws JobExecutionException
   */
  @Override
  public void execute(JobExecutionContext context) throws JobExecutionException {
    JobKey jobKey = context.getJobDetail().getKey();
    LOG.debug("Executing linear job: " + jobKey);
    JobDataMap jobDataMap = context.getMergedJobDataMap();

    if (!executionScheduleManager.continueOnMisfire(context)) {
      throw new JobExecutionException("Canceled execution based on misfire"
View Full Code Here

    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());
    expectLastCall().andThrow(new AmbariException("Test Exception")).anyTimes();
View Full Code Here

        {
          throw new ProvisionException( format( "Impossible to schedule Job '%s' with cron expression " +
                                                "and an associated Trigger at the same time", jobClass.getName() ) );
        }

        JobKey jobKey = jobKey( DEFAULT.equals( jobName ) ? jobClass.getName() : jobName, jobGroup );
        TriggerKey triggerKey = triggerKey( DEFAULT.equals( triggerName ) ? jobClass.getCanonicalName() : triggerName, triggerGroup );

        if ( updateExistingTrigger && scheduler.checkExists( triggerKey ) ) {
            scheduler.unscheduleJob( triggerKey );
        }
View Full Code Here

     */
    @Override
    public boolean deleteJob(final String jobName, final String jobGroup) {
        boolean deletedJob = false;
        try {
            deletedJob = getScheduler().deleteJob(new JobKey(jobName, jobGroup));
        } catch(final SchedulerException se) {
            LOG.error("Failed to delete job '" + jobName + "': " + se.getMessage(), se);
        }
        return deletedJob;
    }
View Full Code Here

     */
    @Override
    public boolean pauseJob(final String jobName, final String jobGroup) {
        boolean pausedJob = false;
        try {
            getScheduler().pauseJob(new JobKey(jobName, jobGroup));
            pausedJob = true;
        } catch(final SchedulerException se) {
            LOG.error( "Failed to pause job '" + jobName + "': " + se.getMessage(), se);
        }
        return pausedJob;
View Full Code Here

     */
    @Override
    public boolean resumeJob(final String jobName, final String jobGroup) {
        boolean resumedJob = false;
        try {
            getScheduler().resumeJob(new JobKey(jobName, jobGroup));
            resumedJob = true;
        } catch(final SchedulerException se) {
            LOG.error("Failed to resume job '" + jobName + "': " + se.getMessage(), se);
        }
        return resumedJob;
View Full Code Here

                    //create an XQuery job
                    final Subject guestUser = brokerPool.getSecurityManager().getGuestSubject();
                    job = new UserXQueryJob(jobConfig.getJobName(), jobConfig.getResourceName(), guestUser);
                    try {
                        // check if a job with the same name is already registered
                        if(getScheduler().getJobDetail(new JobKey(job.getName(), UserJob.JOB_GROUP)) != null) {
                            // yes, try to make the job's name unique
                            ((UserXQueryJob)job).setName(job.getName() + job.hashCode());
                        }
                       
                    } catch(final SchedulerException e) {
View Full Code Here

            }
        }
    }

    public void deleteRouteJob(Action action, ScheduledRouteDetails scheduledRouteDetails) throws SchedulerException {
        JobKey jobKey = retrieveJobKey(action, scheduledRouteDetails);
       
        if (!getScheduler().isShutdown()) {
            getScheduler().deleteJob(jobKey);
        }
View Full Code Here

       
        return result;
    }
   
    public JobKey retrieveJobKey(Action action, ScheduledRouteDetails scheduledRouteDetails) {
        JobKey result = null;

        if (action == Action.START) {
            result = scheduledRouteDetails.getStartJobKey();
        } else if (action == Action.STOP) {
            result = scheduledRouteDetails.getStopJobKey();
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.