クラス DefaultBatchConfiguration
java.lang.ObjectSE
org.springframework.batch.core.configuration.support.DefaultBatchConfiguration
- 実装されたすべてのインターフェース:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
@Configuration(proxyBeanMethods=false)
@Import(ScopeConfiguration.class)
public class DefaultBatchConfiguration
extends ObjectSE
implements org.springframework.context.ApplicationContextAware
Spring Batch を有効にして使用するための一般的な JDBC ベースのインフラストラクチャ Bean を提供するベース
Configuration
クラス。この構成クラスは、アプリケーションコンテキストで次の Bean を構成および登録します。
- "jobRepository" という名前の
JobRepository
- "jobExplorer" という名前の
JobExplorer
- "jobLauncher" という名前の
JobLauncher
- "jobRegistry" という名前の
JobRegistry
- "JobOperator" という名前の
JobOperator
- "jobRegistryBeanPostProcessor" という名前の
JobRegistryBeanPostProcessor
- "stepScope" という名前の
StepScope
- "jobScope" という名前の
JobScope
このクラスの一般的な使用箇所は次のとおりです。
@Configuration public class MyJobConfiguration extends DefaultBatchConfiguration { @Bean public Job job(JobRepository jobRepository) { return new JobBuilder("myJob", jobRepository) // define job flow as needed .build(); } }
- 導入:
- 5.0
- 作成者:
- Dave Syer, Michael Minella, Mahmoud Ben Hassine, Taeik Lim
フィールドサマリー
フィールドコンストラクターのサマリー
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected CharsetSE
実行コンテキストをシリアライズ / デシリアライズするときに使用するCharset
SE を返します。protected int
Types
SE クラスから値を返し、CLOB に使用する型を示しますprotected org.springframework.core.convert.support.ConfigurableConversionService
ジョブリポジトリとジョブエクスプローラーで使用する変換サービスを返します。protected StringSE
データベースの種類を返します。protected DataSourceSE
Batch メタデータに使用するデータソースを返します。protected ExecutionContextSerializer
ExecutionContextSerializer
のカスタム実装。protected DataFieldMaxValueIncrementerFactory
メタデータテーブルのエンティティ ID をインクリメントするために使用されるDataFieldMaxValueIncrementer
実装を作成するためのファクトリを返します。protected org.springframework.transaction.annotation.Isolation
ジョブ実行の作成時にトランザクション分離レベルを返します。protected org.springframework.jdbc.core.JdbcOperations
JdbcOperations
を返します。protected JobKeyGenerator
JobKeyGenerator
のカスタム実装。protected org.springframework.jdbc.support.lob.LobHandler
ラージオブジェクト用の特別なハンドラー。protected int
データベース内の長い文字列列の長さを返します。protected StringSE
Batch メタデータテーブルのプレフィックスを返します。protected org.springframework.core.task.TaskExecutor
ジョブランチャーで使用するTaskExecutor
を返します。protected org.springframework.transaction.PlatformTransactionManager
ジョブリポジトリに使用するトランザクションマネージャーを返します。protected boolean
validateTransactionState
パラメーターの値を返します。JobRegistryBeanPostProcessor
Bean を定義します。void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext)
フィールドの詳細
applicationContext
@Autowired protected org.springframework.context.ApplicationContext applicationContext
コンストラクターの詳細
DefaultBatchConfiguration
public DefaultBatchConfiguration()
メソッドの詳細
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - 次で指定:
- インターフェース
org.springframework.context.ApplicationContextAware
のsetApplicationContext
- 例外:
org.springframework.beans.BeansException
jobRepository
jobLauncher
jobExplorer
jobRegistry
jobOperator
jobRegistryBeanPostProcessor
@Bean public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor() throws BatchConfigurationExceptionJobRegistryBeanPostProcessor
Bean を定義します。- 戻り値:
JobRegistryBeanPostProcessor
Bean- 例外:
BatchConfigurationException
- Bean を登録できない場合- 導入:
- 5.1
getDataSource
Batch メタデータに使用するデータソースを返します。デフォルトは型DataSource
SE の Bean で、アプリケーションコンテキストで "dataSource" という名前が付けられます。- 戻り値:
- Batch メタデータに使用するデータソース
getTransactionManager
protected org.springframework.transaction.PlatformTransactionManager getTransactionManager()ジョブリポジトリに使用するトランザクションマネージャーを返します。デフォルトは型PlatformTransactionManager
の Bean で、アプリケーションコンテキストで "transactionManager" という名前が付けられます。- 戻り値:
- ジョブリポジトリに使用するトランザクションマネージャー
getValidateTransactionState
protected boolean getValidateTransactionState()validateTransactionState
パラメーターの値を返します。デフォルトはtrue
です。- 戻り値:
- トランザクションの状態を検証する必要がある場合は true、そうでない場合は false
getIsolationLevelForCreate
protected org.springframework.transaction.annotation.Isolation getIsolationLevelForCreate()ジョブ実行の作成時にトランザクション分離レベルを返します。デフォルトはIsolation.SERIALIZABLE
です。- 戻り値:
- ジョブ実行を作成するときのトランザクション分離レベル
getMaxVarCharLength
protected int getMaxVarCharLength()データベース内の長い文字列列の長さを返します。スキーマを変更していない場合は、これをオーバーライドしないでください。この値は、JdbcJobExecutionDao
とJdbcStepExecutionDao
の両方で終了メッセージに使用され、JdbcExecutionContextDao
の短いバージョンの実行コンテキストにも使用されることに注意してください。マルチバイト文字セットを使用するデータベースの場合、この数値は、テーブルの DDL での列の長さの宣言よりも小さくすることができます (2 バイト文字の場合は最大 2 倍)。デフォルトはAbstractJdbcBatchMetadataDao.DEFAULT_EXIT_MESSAGE_LENGTH
getTablePrefix
Batch メタデータテーブルのプレフィックスを返します。デフォルトはAbstractJdbcBatchMetadataDao.DEFAULT_TABLE_PREFIX
です。- 戻り値:
- メタデータテーブルのプレフィックス
getCharset
実行コンテキストをシリアライズ / デシリアライズするときに使用するCharset
SE を返します。デフォルトは "UTF-8" です。- 戻り値:
- 実行コンテキストをシリアライズ / デシリアライズするときに使用する文字セット
getLobHandler
protected org.springframework.jdbc.support.lob.LobHandler getLobHandler()ラージオブジェクト用の特別なハンドラー。Oracle の一部の (通常は古い) バージョンを除いて、通常はデフォルトで問題ありません。- 戻り値:
- 使用する
LobHandler
getJdbcOperations
protected org.springframework.jdbc.core.JdbcOperations getJdbcOperations()JdbcOperations
を返します。このプロパティがオーバーライドされていない場合、デフォルトで、構成されたデータソースに対して新しいJdbcTemplate
が作成されます。- 戻り値:
- 使用する
JdbcOperations
getExecutionContextSerializer
ExecutionContextSerializer
のカスタム実装。注入されない場合のデフォルトはDefaultExecutionContextSerializer
です。- 戻り値:
- 実行コンテキストのシリアライズ / デシリアライズに使用するシリアライザー
getClobType
protected int getClobType()Types
SE クラスから値を返し、CLOB に使用する型を示します- 戻り値:
- CLOB に使用する型を示す
Types
SE クラスの値
getIncrementerFactory
メタデータテーブルのエンティティ ID をインクリメントするために使用されるDataFieldMaxValueIncrementer
実装を作成するためのファクトリを返します。- 戻り値:
DataFieldMaxValueIncrementer
実装を作成するためのファクトリ。
getJobKeyGenerator
JobKeyGenerator
のカスタム実装。注入されない場合のデフォルトはDefaultJobKeyGenerator
です。- 戻り値:
JobInstance
オブジェクトの識別に使用されるキーを作成するジェネレーター- 導入:
- 5.1
getDatabaseType
protected StringSE getDatabaseType() throws org.springframework.jdbc.support.MetaDataAccessExceptionデータベースの種類を返します。デフォルトは、データソースの JDBC メタデータからイントロスペクトされます。- 戻り値:
- データベースの型
- 例外:
org.springframework.jdbc.support.MetaDataAccessException
- JDBC メタデータのデータベース型を取得しようとしてエラーが発生した場合
getTaskExecutor
protected org.springframework.core.task.TaskExecutor getTaskExecutor()ジョブランチャーで使用するTaskExecutor
を返します。デフォルトはSyncTaskExecutor
です。- 戻り値:
- ジョブランチャーで使用する
TaskExecutor
。
getConversionService
protected org.springframework.core.convert.support.ConfigurableConversionService getConversionService()ジョブリポジトリとジョブエクスプローラーで使用する変換サービスを返します。このサービスは、ジョブパラメーターを文字列リテラルから型指定された値に、またはその逆に変換するために使用されます。- 戻り値:
- 使用する
ConfigurableConversionService