Examples of JobFactory


Examples of org.quartz.spi.JobFactory

            return jmxScheduler;
        }

       
        JobFactory jobFactory = null;
        if(jobFactoryClass != null) {
            try {
                jobFactory = (JobFactory) loadHelper.loadClass(jobFactoryClass)
                        .newInstance();
            } catch (Exception e) {
View Full Code Here

Examples of org.springframework.batch.core.configuration.JobFactory

      }
      mainJob
            .setJobExecutionListeners(new JobExecutionListener[] { mainJobExecutionListener });
      mainJob.setJobRepository(jobRepository);
      mainJob.afterPropertiesSet();
      JobFactory jobFactory = new ReferenceJobFactory(mainJob);
      jobRegistry.register(jobFactory);
      logger.info("registered job: " + mainJob.getName());
      JobParameters mainJobParameters = new JobParameters(mainJobParams);
      JobExecution mainJobExecution =
            jobLauncher.run(mainJob, mainJobParameters);
View Full Code Here

Examples of org.springframework.batch.core.configuration.JobFactory

  @Override
  public void register(JobFactory jobFactory) throws DuplicateJobException {
    Assert.notNull(jobFactory);
    String name = jobFactory.getJobName();
    Assert.notNull(name, "Job configuration must have a name.");
    JobFactory previousValue = map.putIfAbsent(name, jobFactory);
    if (previousValue != null) {
      throw new DuplicateJobException("A job configuration with this name [" + name
          + "] was already registered");
    }
  }
View Full Code Here

Examples of org.springframework.batch.core.configuration.JobFactory

    map.remove(name);
  }

  @Override
  public Job getJob(String name) throws NoSuchJobException {
    JobFactory factory = map.get(name);
    if (factory == null) {
      throw new NoSuchJobException("No job configuration with the name [" + name + "] was registered");
    } else {
      return factory.createJob();
    }
  }
View Full Code Here

Examples of org.springframework.batch.core.configuration.JobFactory

  /**
   * Test method for {@link org.springframework.batch.core.configuration.support.MapJobRegistry#getJob(java.lang.String)}.
   */
  public void testRealDuplicateConfiguration() throws Exception {
    JobFactory jobFactory = new ReferenceJobFactory(new JobSupport("foo"));
    registry.register(jobFactory);
    try {
      registry.register(jobFactory);
      fail("Unexpected DuplicateJobConfigurationException");
    } catch (DuplicateJobException e) {
View Full Code Here

Examples of org.springframework.batch.core.configuration.JobFactory

  /**
   * Test method for {@link org.springframework.batch.core.configuration.support.MapJobRegistry#getJobNames()}.
   * @throws Exception
   */
  public void testGetJobConfigurations() throws Exception {
    JobFactory jobFactory = new ReferenceJobFactory(new JobSupport("foo"));
    registry.register(jobFactory);
    registry.register(new ReferenceJobFactory(new JobSupport("bar")));
    Collection<String> configurations = registry.getJobNames();
    assertEquals(2, configurations.size());
    assertTrue(configurations.contains(jobFactory.getJobName()));
  }
View Full Code Here

Examples of org.springframework.batch.core.configuration.JobFactory

   * @throws Exception
   */
  @Test
  public void testBind() throws Exception {
    listener.setJobRegistry(registry);
    listener.bind(new JobFactory() {
      @Override
      public Job createJob() {
        return null;
      }

View Full Code Here

Examples of org.springframework.batch.core.configuration.JobFactory

   * @throws Exception
   */
  @Test
  public void testUnbind() throws Exception {
    testBind();
    listener.unbind(new JobFactory() {
      @Override
      public Job createJob() {
        return null;
      }

View Full Code Here

Examples of org.springframework.batch.core.configuration.JobFactory

   * @param context the context in which the job is defined
   * @param job the job to register
   * @throws DuplicateJobException if that job is already registered
   */
  private void doRegister(ConfigurableApplicationContext context, Job job) throws DuplicateJobException {
    final JobFactory jobFactory = new ReferenceJobFactory(job);
    jobRegistry.register(jobFactory);

    if (stepRegistry != null) {
      if (!(job instanceof StepLocator)) {
        throw new UnsupportedOperationException("Cannot locate steps from a Job that is not a StepLocator: job="
View Full Code Here

Examples of org.springframework.xd.dirt.job.JobFactory

      try {
        StreamFactory streamFactory = new StreamFactory(streamDefinitionRepository, moduleRegistry,
            moduleOptionsMetadataResolver);

        JobFactory jobFactory = new JobFactory(jobDefinitionRepository, moduleRegistry,
            moduleOptionsMetadataResolver);

        String requestedModulesPath = Paths.build(Paths.MODULE_DEPLOYMENTS, Paths.REQUESTED);
        Paths.ensurePath(client, requestedModulesPath);
        String allocatedModulesPath = Paths.build(Paths.MODULE_DEPLOYMENTS, Paths.ALLOCATED);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.