use of org.jberet.repository.JdbcRepository in project wildfly by wildfly.
the class JdbcJobRepositoryService method startJobRepository.
@Override
public void startJobRepository(final StartContext context) throws StartException {
final ExecutorService service = executor.getValue();
final Runnable task = () -> {
try {
// Currently in jBeret tables are created in the constructor which is why this is done asynchronously
jobRepository = new JdbcRepository(dataSourceValue.getValue());
context.complete();
} catch (Exception e) {
context.failed(BatchLogger.LOGGER.failedToCreateJobRepository(e, "JDBC"));
}
};
try {
service.execute(task);
} catch (RejectedExecutionException e) {
task.run();
} finally {
context.asynchronous();
}
}
Aggregations