Search in sources :

Example 1 with BatchConfiguration

use of org.wildfly.extension.batch.jberet.BatchConfiguration in project wildfly by wildfly.

the class BatchEnvironmentService method start.

@Override
public synchronized void start(final StartContext context) throws StartException {
    BatchLogger.LOGGER.debugf("Creating batch environment; %s", classLoader);
    final BatchConfiguration batchConfiguration = batchConfigurationInjector.getValue();
    // Find the job executor to use
    JobExecutor jobExecutor = jobExecutorInjector.getOptionalValue();
    if (jobExecutor == null) {
        jobExecutor = batchConfiguration.getDefaultJobExecutor();
    }
    // Find the job repository to use
    JobRepository jobRepository = jobRepositoryInjector.getOptionalValue();
    if (jobRepository == null) {
        jobRepository = batchConfiguration.getDefaultJobRepository();
    }
    this.batchEnvironment = new WildFlyBatchEnvironment(beanManagerInjector.getOptionalValue(), jobExecutor, transactionManagerInjector.getValue(), jobRepository, jobXmlResolver);
    final RequestController requestController = requestControllerInjector.getOptionalValue();
    if (requestController != null) {
        // Create the entry point
        controlPoint = requestController.getControlPoint(deploymentName, "batch-executor-service");
    } else {
        controlPoint = null;
    }
}
Also used : BatchConfiguration(org.wildfly.extension.batch.jberet.BatchConfiguration) JobExecutor(org.jberet.spi.JobExecutor) RequestController(org.wildfly.extension.requestcontroller.RequestController) JobRepository(org.jberet.repository.JobRepository)

Aggregations

JobRepository (org.jberet.repository.JobRepository)1 JobExecutor (org.jberet.spi.JobExecutor)1 BatchConfiguration (org.wildfly.extension.batch.jberet.BatchConfiguration)1 RequestController (org.wildfly.extension.requestcontroller.RequestController)1