名前空間サポート

バージョン 1.3 では、専用の XML 名前空間サポートが Spring Batch Integration に追加されました。これは、より簡単な構成エクスペリエンスを提供することを目的としています。名前空間を使用するには、次の名前空間宣言を Spring XML アプリケーションコンテキストファイルに追加します。

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:batch-int="http://www.springframework.org/schema/batch-integration"
  xsi:schemaLocation="
    http://www.springframework.org/schema/batch-integration
    https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">

    ...

</beans>

次の例は、Spring Batch Integration 用に完全に構成された Spring XML アプリケーションコンテキストファイルを示しています。

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:int="http://www.springframework.org/schema/integration"
  xmlns:batch="http://www.springframework.org/schema/batch"
  xmlns:batch-int="http://www.springframework.org/schema/batch-integration"
  xsi:schemaLocation="
    http://www.springframework.org/schema/batch-integration
    https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd
    http://www.springframework.org/schema/batch
    https://www.springframework.org/schema/batch/spring-batch.xsd
    http://www.springframework.org/schema/beans
    https://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/integration
    https://www.springframework.org/schema/integration/spring-integration.xsd">

    ...

</beans>

参照される XSD ファイルにバージョン番号を追加することもできます。ただし、バージョンなしの宣言では常に最新のスキーマが使用されるため、通常、バージョン番号を XSD 名に追加することはお勧めしません。バージョン番号を追加すると、Spring Batch Integration の依存関係を更新するときに、より新しいバージョンの XML スキーマが必要になる可能性があるため、問題が発生する可能性があります。