Package org.quartz.impl

Examples of org.quartz.impl.JobDetailImpl


     * @return JobDetail
     */
    public static JobDetail newJobDetail(CompositeData cData)
      throws ClassNotFoundException
    {
        JobDetailImpl jobDetail = new JobDetailImpl();

        int i = 0;
        jobDetail.setName((String) cData.get(ITEM_NAMES[i++]));
        jobDetail.setGroup((String) cData.get(ITEM_NAMES[i++]));
        jobDetail.setDescription((String) cData.get(ITEM_NAMES[i++]));
        Class<?> jobClass = Class.forName((String) cData.get(ITEM_NAMES[i++]));
        @SuppressWarnings("unchecked")
        Class<? extends Job> jobClassTyped = (Class<? extends Job>)jobClass;
        jobDetail.setJobClass(jobClassTyped);
        jobDetail.setJobDataMap(JobDataMapSupport.newJobDataMap((TabularData) cData.get(ITEM_NAMES[i++])));
        jobDetail.setDurability((Boolean) cData.get(ITEM_NAMES[i++]));
        jobDetail.setRequestsRecovery((Boolean) cData.get(ITEM_NAMES[i++]));

        return jobDetail;
    }
View Full Code Here


     * @return JobDetail
     */
    public static JobDetail newJobDetail(Map<String, Object> attrMap)
        throws ClassNotFoundException
    {
        JobDetailImpl jobDetail = new JobDetailImpl();

        int i = 0;
        jobDetail.setName((String) attrMap.get(ITEM_NAMES[i++]));
        jobDetail.setGroup((String) attrMap.get(ITEM_NAMES[i++]));
        jobDetail.setDescription((String) attrMap.get(ITEM_NAMES[i++]));
        Class<?> jobClass = Class.forName((String) attrMap.get(ITEM_NAMES[i++]));
        @SuppressWarnings("unchecked")
        Class<? extends Job> jobClassTyped = (Class<? extends Job>)jobClass;
        jobDetail.setJobClass(jobClassTyped);
        if(attrMap.containsKey(ITEM_NAMES[i])) {
            @SuppressWarnings("unchecked")
            Map<String, Object> map = (Map<String, Object>)attrMap.get(ITEM_NAMES[i]);
            jobDetail.setJobDataMap(JobDataMapSupport.newJobDataMap(map));
        }
        i++;
        if(attrMap.containsKey(ITEM_NAMES[i])) {
            jobDetail.setDurability((Boolean) attrMap.get(ITEM_NAMES[i]));
        }
        i++;
        if(attrMap.containsKey(ITEM_NAMES[i])) {
            jobDetail.setRequestsRecovery((Boolean) attrMap.get(ITEM_NAMES[i]));
        }
        i++;
       
        return jobDetail;
    }
View Full Code Here

          "to be able to handle an 'applicationContextJobDataKey'");
      }
      getJobDataMap().put(this.applicationContextJobDataKey, this.applicationContext);
    }

    JobDetailImpl jdi = new JobDetailImpl();
    jdi.setName(this.name);
    jdi.setGroup(this.group);
    jdi.setJobClass((Class) this.jobClass);
    jdi.setJobDataMap(this.jobDataMap);
    jdi.setDurability(this.durability);
    jdi.setRequestsRecovery(this.requestsRecovery);
    jdi.setDescription(this.description);
    this.jobDetail = jdi;
  }
View Full Code Here

    // Consider the concurrent flag to choose between stateful and stateless job.
    Class<?> jobClass = (this.concurrent ? MethodInvokingJob.class : StatefulMethodInvokingJob.class);

    // Build JobDetail instance.
    JobDetailImpl jdi = new JobDetailImpl();
    jdi.setName(name);
    jdi.setGroup(this.group);
    jdi.setJobClass((Class) jobClass);
    jdi.setDurability(true);
    jdi.getJobDataMap().put("methodInvoker", this);
    this.jobDetail = jdi;

    postProcessJobDetail(this.jobDetail);
  }
View Full Code Here

                      repoConfig.getId() );
            cronString = CRON_HOURLY;
        }

        // setup the unprocessed artifact job
        JobDetailImpl repositoryJob =
            new JobDetailImpl( REPOSITORY_JOB + ":" + repoConfig.getId(), REPOSITORY_SCAN_GROUP,
                               RepositoryTaskJob.class );

        repositoryJob.getJobDataMap().put( TASK_QUEUE, repositoryScanningQueue );
        repositoryJob.getJobDataMap().put( TASK_REPOSITORY, repoConfig.getId() );

        try
        {
            CronTriggerImpl trigger =
                new CronTriggerImpl( REPOSITORY_JOB_TRIGGER + ":" + repoConfig.getId(), REPOSITORY_SCAN_GROUP,
View Full Code Here

    Assume.group(TestGroup.PERFORMANCE);

    CountingTaskExecutor taskExecutor = new CountingTaskExecutor();
    DummyJob.count = 0;

    JobDetailImpl jobDetail = new JobDetailImpl();
    jobDetail.setDurability(true);
    jobDetail.setJobClass(DummyJob.class);
    jobDetail.setName("myJob");

    SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
    trigger.setName("myTrigger");
    trigger.setJobDetail(jobDetail);
    trigger.setStartDelay(1);
View Full Code Here

  }

  @Test(expected = IllegalArgumentException.class)
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public void jobDetailWithRunnableInsteadOfJob() {
    JobDetailImpl jobDetail = new JobDetailImpl();
    jobDetail.setJobClass((Class) DummyRunnable.class);
  }
View Full Code Here

    Assume.group(TestGroup.PERFORMANCE);

    DummyJob.param = 0;
    DummyJob.count = 0;

    JobDetailImpl jobDetail = new JobDetailImpl();
    jobDetail.setDurability(true);
    jobDetail.setJobClass(DummyJobBean.class);
    jobDetail.setName("myJob");
    jobDetail.getJobDataMap().put("param", "10");

    SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
    trigger.setName("myTrigger");
    trigger.setJobDetail(jobDetail);
    trigger.setStartDelay(1);
View Full Code Here

    Assume.group(TestGroup.PERFORMANCE);

    DummyJob.param = 0;
    DummyJob.count = 0;

    JobDetailImpl jobDetail = new JobDetailImpl();
    jobDetail.setDurability(true);
    jobDetail.setJobClass(DummyJob.class);
    jobDetail.setName("myJob");
    jobDetail.getJobDataMap().put("param", "10");
    jobDetail.getJobDataMap().put("ignoredParam", "10");

    SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
    trigger.setName("myTrigger");
    trigger.setJobDetail(jobDetail);
    trigger.setStartDelay(1);
View Full Code Here

    Assume.group(TestGroup.PERFORMANCE);

    DummyJob.param = 0;
    DummyJob.count = 0;

    JobDetailImpl jobDetail = new JobDetailImpl();
    jobDetail.setDurability(true);
    jobDetail.setJobClass(DummyJob.class);
    jobDetail.setName("myJob");
    jobDetail.getJobDataMap().put("para", "10");
    jobDetail.getJobDataMap().put("ignoredParam", "10");

    SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
    trigger.setName("myTrigger");
    trigger.setJobDetail(jobDetail);
    trigger.setStartDelay(1);
View Full Code Here

TOP

Related Classes of org.quartz.impl.JobDetailImpl

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.