Conditionally add custom scopes when using XML configuration
When using a combination of Java configuration and the XML namespace configuration, prior to this commit, we would add the batch custom scopes twice which lead to issues. This commit gives priority to the custom scopes provided by the java configuration. If you've used @EnableBatchProcessing and have configured batch components using the batch namespace, the custom scopes that come with the java config will take precidence. This commit addresses Jira BATCH-2266
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd">
|
||||
|
||||
<bean id="tasklet" class="org.springframework.batch.core.configuration.annotation.StepScopeConfigurationTests$TaskletSupport"/>
|
||||
|
||||
<job id="job" xmlns="http://www.springframework.org/schema/batch">
|
||||
<step id="step1">
|
||||
<tasklet ref="tasklet"/>
|
||||
</step>
|
||||
</job>
|
||||
|
||||
<bean id="xmlValue" class="org.springframework.batch.core.configuration.annotation.StepScopeConfigurationTests.SimpleHolder" scope="step">
|
||||
<constructor-arg value="#{stepExecution.stepName}" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user