Skip to content

Commit

Permalink
change version 5.6.0.RELEASE
Browse files Browse the repository at this point in the history
  • Loading branch information
btsoshim committed Mar 29, 2024
1 parent 4b6530c commit b56debd
Show file tree
Hide file tree
Showing 38 changed files with 1,414 additions and 654 deletions.
6 changes: 3 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ The tutorial consists of

== Getting started
* If you would like to try tutorials,
Go to https://terasoluna-batch.github.io/guideline/5.5.0.RELEASE/ja/single_index.html#Ch09[Tutorial] and follow the tutorial instructions explained in Development Guideline.
Go to https://terasoluna-batch.github.io/guideline/5.6.0.RELEASE/ja/single_index.html#Ch09[Tutorial] and follow the tutorial instructions explained in Development Guideline.
* If you would like to access completed,
Please download completed tutorials in this repository. See next section about how to get.

== How to get completed tutorials
* Get it in one of the following ways:
** Download as archived files
1. Go to the https://github.com/terasoluna-batch/v5-tutorial/releases/tag/5.5.0.RELEASE[tag/5.5.0.RELEASE] page.
1. Go to the https://github.com/terasoluna-batch/v5-tutorial/releases/tag/5.6.0.RELEASE[tag/5.6.0.RELEASE] page.
2. Download zip or tar.gz files and unzip it.
** Fork or checkout Refer release tags such as ``5.5.0.RELEASE``.
** Fork or checkout Refer release tags such as ``5.6.0.RELEASE``.

* Copy the configraion files to the ``src/main`` directory.
** Execute the following command in the ``terasoluna-batch-tutorial`` directory.
Expand Down
43 changes: 34 additions & 9 deletions terasoluna-batch-tutorial/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.terasoluna.batch</groupId>
<artifactId>terasoluna-batch-tutorial</artifactId>
<version>5.5.0.RELEASE</version>
<version>5.6.0.RELEASE</version>

<name>TERASOLUNA Batch Framework for Java (5.x) Tutorial Project</name>
<description>Tutorial Project using TERASOLUNA Batch Framework for Java (5.x)</description>
Expand Down Expand Up @@ -40,13 +40,12 @@
<id>terasoluna-batch-snapshots</id>
<url>http://repo.terasoluna.org/nexus/content/repositories/terasoluna-batch-snapshots/</url>
</repository>

</repositories>

<properties>
<!-- == Maven Plugin Versions == -->
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<gmavenplus-plugin.version>1.13.1</gmavenplus-plugin.version>
<gmavenplus-plugin.version>3.0.2</gmavenplus-plugin.version>
<maven-dependency-plugin.version>3.3.0</maven-dependency-plugin.version>
<maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
Expand All @@ -57,15 +56,15 @@

<!-- == Dependency Versions == -->
<!-- == Spring Boot Dependencies == -->
<org.springframework.boot.version>3.0.1</org.springframework.boot.version>
<org.springframework.boot.version>3.2.2</org.springframework.boot.version>

<!-- == TERASOLUNA Batch == -->
<terasoluna-batch.version>${project.version}</terasoluna-batch.version>

<!-- == Spock == -->
<org.spockframework.spock-core.version>2.2-groovy-3.0</org.spockframework.spock-core.version>
<org.spockframework.spock-spring.version>2.2-groovy-3.0</org.spockframework.spock-spring.version>
<com.athaydes.spock-reports.version>2.3.0-groovy-3.0</com.athaydes.spock-reports.version>
<org.spockframework.spock-core.version>2.3-groovy-3.0</org.spockframework.spock-core.version>
<org.spockframework.spock-spring.version>2.3-groovy-3.0</org.spockframework.spock-spring.version>
<com.athaydes.spock-reports.version>2.5.1-groovy-3.0</com.athaydes.spock-reports.version>

<!-- == Mongo== -->
<mongo-java-driver.version>2.14.3</mongo-java-driver.version>
Expand All @@ -83,11 +82,14 @@
<!-- == Project Properties == -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<encoding>UTF-8</encoding>
<java-version>17</java-version>
<java-version>21</java-version>
<project.root.basedir>${project.basedir}</project.root.basedir>

<!-- == Groovy == -->
<groovy.version>3.0.11</groovy.version>
<groovy.version>3.0.19</groovy.version>

<!-- == slf4j-api == -->
<slf4j-api.version>2.0.12</slf4j-api.version>

<!-- == Java Config/XML Config == -->
<profile-name>javaconfig</profile-name>
Expand Down Expand Up @@ -189,6 +191,13 @@
<artifactId>jakarta.el</artifactId>
<version>${jakarta.el.version}</version>
</dependency>
<!-- == Begin slf4j-api == -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<!-- == End slf4j-api == -->
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -299,6 +308,12 @@
<artifactId>spock-reports</artifactId>
<scope>test</scope>
</dependency>

<!-- == Begin slf4j-api == -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -597,5 +612,15 @@
<profile-name>xmlconfig</profile-name>
</properties>
</profile>

<profile>
<id>jdk17</id>
<activation>
<jdk>17</jdk>
</activation>
<properties>
<java-version>17</java-version>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
*/
package org.terasoluna.batch.tutorial.config;

import java.io.IOException;
import java.util.Properties;

import javax.sql.DataSource;

import org.apache.ibatis.mapping.DatabaseIdProvider;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
import org.apache.ibatis.session.ExecutorType;
Expand All @@ -23,7 +28,10 @@
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.mapper.MapperFactoryBean;
import org.springframework.batch.core.configuration.JobRegistry;
import org.springframework.batch.core.configuration.support.*;
import org.springframework.batch.core.configuration.support.ApplicationContextFactory;
import org.springframework.batch.core.configuration.support.AutomaticJobRegistrar;
import org.springframework.batch.core.configuration.support.DefaultJobLoader;
import org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor;
import org.springframework.batch.core.launch.JobOperator;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -45,13 +53,8 @@
import org.terasoluna.batch.async.db.repository.BatchJobRequestRepository;
import org.terasoluna.batch.tutorial.config.helper.ApplicationContextFactoryHelper;

import javax.sql.DataSource;
import java.io.IOException;
import java.util.Properties;

/**
* Acync Batch Daemon Configuration.
*
* @since 5.5.0
*/
@Configuration
Expand All @@ -66,7 +69,8 @@ public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderCon
}

@Bean
public ThreadPoolTaskExecutor daemonTaskExecutor(@Value("${async-batch-daemon.job-concurrency-num:#{null}}") int concurrency) {
public ThreadPoolTaskExecutor daemonTaskExecutor(
@Value("${async-batch-daemon.job-concurrency-num}") int concurrency) {
final ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setCorePoolSize(concurrency);
threadPoolTaskExecutor.setMaxPoolSize(concurrency);
Expand All @@ -75,39 +79,45 @@ public ThreadPoolTaskExecutor daemonTaskExecutor(@Value("${async-batch-daemon.jo
}

@Bean
public ThreadPoolTaskScheduler daemonTaskScheduler(@Value("${async-batch-daemon.scheduler.size:#{null}}") int size) {
public ThreadPoolTaskScheduler daemonTaskScheduler(
@Value("${async-batch-daemon.scheduler.size}") int size) {
final ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
threadPoolTaskScheduler.setPoolSize(size);
return threadPoolTaskScheduler;
}

@Bean
public DataSourceInitializer asyncDataSourceInitializer(@Qualifier("adminDataSource") DataSource adminDataSource,
@Value("${data-source.initialize.enabled:false}") boolean enabled,
@Value("${async-batch-daemon.schema.script:#{null}}") Resource script,
@Value("${terasoluna-batch.commit.script:#{null}}") Resource commitScript) {
public DataSourceInitializer asyncDataSourceInitializer(
@Qualifier("adminDataSource") DataSource adminDataSource,
@Value("${data-source.initialize.enabled:false}") boolean enabled,
@Value("${async-batch-daemon.schema.script}") Resource script,
@Value("${terasoluna-batch.commit.script}") Resource commitScript) {
final DataSourceInitializer asyncDataSourceInitializer = new DataSourceInitializer();
asyncDataSourceInitializer.setDataSource(adminDataSource);
asyncDataSourceInitializer.setEnabled(enabled);
ResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator(script, commitScript);
ResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator(
script, commitScript);
resourceDatabasePopulator.setContinueOnError(true);
asyncDataSourceInitializer.setDatabasePopulator(resourceDatabasePopulator);
asyncDataSourceInitializer.setDatabasePopulator(
resourceDatabasePopulator);
return asyncDataSourceInitializer;
}

@Bean
public JobRequestPollTask jobRequestPollTask(@Qualifier("adminTransactionManager") PlatformTransactionManager adminTransactionManager,
JobOperator jobOperator,
BatchJobRequestRepository batchJobRequestRepository,
@Qualifier("daemonTaskExecutor") ThreadPoolTaskExecutor daemonTaskExecutor,
AutomaticJobRegistrar automaticJobRegistrar) {
return new JobRequestPollTask(batchJobRequestRepository, adminTransactionManager, daemonTaskExecutor, jobOperator,
automaticJobRegistrar);
public JobRequestPollTask jobRequestPollTask(
@Qualifier("adminTransactionManager") PlatformTransactionManager adminTransactionManager,
JobOperator jobOperator,
BatchJobRequestRepository batchJobRequestRepository,
@Qualifier("daemonTaskExecutor") ThreadPoolTaskExecutor daemonTaskExecutor,
AutomaticJobRegistrar automaticJobRegistrar) {
return new JobRequestPollTask(batchJobRequestRepository, adminTransactionManager,
daemonTaskExecutor, jobOperator, automaticJobRegistrar);
}

@Bean
public SqlSessionFactory adminSqlSessionFactory(@Qualifier("adminDataSource") DataSource adminDataSource,
DatabaseIdProvider databaseIdProvider) throws Exception {
public SqlSessionFactory adminSqlSessionFactory(
@Qualifier("adminDataSource") DataSource adminDataSource,
DatabaseIdProvider databaseIdProvider) throws Exception {
final SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(adminDataSource);
sqlSessionFactoryBean.setDatabaseIdProvider(databaseIdProvider);
Expand All @@ -132,22 +142,26 @@ public MapperFactoryBean<BatchJobRequestRepository> batchJobRequestRepository(

@Bean
public AutomaticJobRegistrar automaticJobRegistrar(ResourceLoader resourceLoader, JobRegistry jobRegistry,
ApplicationContextFactory[] applicationContextFactories) throws Exception {
ApplicationContextFactory[] applicationContextFactories) throws Exception {
final AutomaticJobRegistrar automaticJobRegistrar = new AutomaticJobRegistrar();
final DefaultJobLoader defaultJobLoader = new DefaultJobLoader();
defaultJobLoader.setJobRegistry(jobRegistry);
automaticJobRegistrar.setApplicationContextFactories(applicationContextFactories);
automaticJobRegistrar.setApplicationContextFactories(
applicationContextFactories);
automaticJobRegistrar.setJobLoader(defaultJobLoader);
return automaticJobRegistrar;
}

@Bean
public ApplicationContextFactory[] applicationContextFactories(final ApplicationContext ctx) throws IOException {
return new ApplicationContextFactoryHelper(ctx).load("classpath:/META-INF/jobs/*.xml");
public ApplicationContextFactory[] applicationContextFactories(
final ApplicationContext ctx) throws IOException {
return new ApplicationContextFactoryHelper(ctx).load(
"classpath:org/terasoluna/batch/tutorial/jobs/*.class");
}

@Bean
public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor(JobRegistry jobRegistry) {
public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor(
JobRegistry jobRegistry) {
final JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor = new JobRegistryBeanPostProcessor();
jobRegistryBeanPostProcessor.setJobRegistry(jobRegistry);
return jobRegistryBeanPostProcessor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* Job Base Context Configuration.
*
* @since 5.5.0
*/
@Configuration
Expand Down
Loading

0 comments on commit b56debd

Please sign in to comment.