diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepContribution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepContribution.java index 42c04ea95..5efacb03c 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepContribution.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepContribution.java @@ -15,7 +15,7 @@ */ package org.springframework.batch.core.domain; -import org.springframework.batch.item.StreamContext; +import org.springframework.batch.item.ExecutionAttributes; /** * Represents a contribution to a {@link StepExecution}, buffering changes @@ -30,7 +30,7 @@ public class StepContribution { private StepExecution execution; - private StreamContext streamContext; + private ExecutionAttributes streamContext; private int commitCount; @@ -69,15 +69,15 @@ public class StepContribution { * * @param streamContext */ - public void setStreamContext(StreamContext streamContext) { + public void setStreamContext(ExecutionAttributes streamContext) { this.streamContext = streamContext; } /** - * Public getter for the {@link StreamContext}. + * Public getter for the {@link ExecutionAttributes}. * @return the stream context */ - public StreamContext getStreamContext() { + public ExecutionAttributes getStreamContext() { return streamContext; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepExecution.java index f05e8f6b4..b8b26cc49 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepExecution.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepExecution.java @@ -18,7 +18,7 @@ package org.springframework.batch.core.domain; import java.util.Date; -import org.springframework.batch.item.StreamContext; +import org.springframework.batch.item.ExecutionAttributes; import org.springframework.batch.repeat.ExitStatus; /** @@ -51,7 +51,7 @@ public class StepExecution extends Entity { private Date endTime = null; - private StreamContext streamContext = new StreamContext(); + private ExecutionAttributes streamContext = new ExecutionAttributes(); private ExitStatus exitStatus = ExitStatus.UNKNOWN; @@ -88,11 +88,11 @@ public class StepExecution extends Entity { taskCount++; } - public StreamContext getStreamContext() { + public ExecutionAttributes getStreamContext() { return streamContext; } - public void setStreamContext(StreamContext statistics) { + public void setStreamContext(ExecutionAttributes statistics) { this.streamContext = statistics; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepInstance.java b/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepInstance.java index 3c8989862..ed2495c29 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepInstance.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/domain/StepInstance.java @@ -16,7 +16,7 @@ package org.springframework.batch.core.domain; -import org.springframework.batch.item.StreamContext; +import org.springframework.batch.item.ExecutionAttributes; /** *
@@ -49,7 +49,7 @@ public class StepInstance extends Entity { private BatchStatus status; - private StreamContext streamContext = new StreamContext(); + private ExecutionAttributes streamContext = new ExecutionAttributes(); private int stepExecutionCount = 0; @@ -84,11 +84,11 @@ public class StepInstance extends Entity { this.stepExecutionCount = stepExecutionCount; } - public StreamContext getStreamContext() { + public ExecutionAttributes getStreamContext() { return streamContext; } - public void setStreamContext(StreamContext streamContext) { + public void setStreamContext(ExecutionAttributes streamContext) { this.streamContext = streamContext; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java index 02f127bce..628598724 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java @@ -22,7 +22,7 @@ import org.springframework.batch.core.domain.JobInstance; import org.springframework.batch.core.domain.JobParameters; import org.springframework.batch.core.domain.StepExecution; import org.springframework.batch.core.domain.StepInstance; -import org.springframework.batch.item.StreamContext; +import org.springframework.batch.item.ExecutionAttributes; /** *
@@ -30,7 +30,7 @@ import org.springframework.batch.item.StreamContext; * must first be obtained using the findOrCreateJob method. Once a Job and it's * related steps are obtained, they can be updated. It should be noted that any * reconstituted steps are expected to contain restart data if the step - * says it wants to be restored after a restart, and {@link StreamContext} + * says it wants to be restored after a restart, and {@link ExecutionAttributes} * exists. *
* diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepContributionTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepContributionTests.java index 154a345b5..b214d29f5 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepContributionTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepContributionTests.java @@ -17,7 +17,7 @@ package org.springframework.batch.core.domain; import junit.framework.TestCase; -import org.springframework.batch.item.StreamContext; +import org.springframework.batch.item.ExecutionAttributes; /** * @author Dave Syer @@ -41,11 +41,11 @@ public class StepContributionTests extends TestCase { /** * Test method for - * {@link org.springframework.batch.core.domain.StepContribution#setStreamContext(StreamContext)}. + * {@link org.springframework.batch.core.domain.StepContribution#setStreamContext(ExecutionAttributes)}. */ public void testSetStreamContext() { assertEquals(null, contribution.getStreamContext()); - StreamContext context = new StreamContext(); + ExecutionAttributes context = new ExecutionAttributes(); context.putString("foo", "bar"); contribution.setStreamContext(context); assertEquals(1, contribution.getStreamContext().getProperties().size()); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepExecutionTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepExecutionTests.java index 699c9a3bc..96145ab2f 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepExecutionTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepExecutionTests.java @@ -19,7 +19,7 @@ import java.util.Date; import junit.framework.TestCase; -import org.springframework.batch.item.StreamContext; +import org.springframework.batch.item.ExecutionAttributes; import org.springframework.batch.repeat.ExitStatus; /** @@ -200,7 +200,7 @@ public class StepExecutionTests extends TestCase { public void testStreamContext() throws Exception { assertNotNull(execution.getStreamContext()); - StreamContext context = new StreamContext(); + ExecutionAttributes context = new ExecutionAttributes(); context.putString("foo", "bar"); execution.setStreamContext(context ); assertEquals("bar", execution.getStreamContext().getString("foo")); diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepInstanceTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepInstanceTests.java index 6c7ac44ab..f8260eb91 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepInstanceTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/domain/StepInstanceTests.java @@ -17,6 +17,7 @@ package org.springframework.batch.core.domain; import junit.framework.TestCase; +import org.springframework.batch.item.ExecutionAttributes; import org.springframework.batch.item.StreamContext; import org.springframework.batch.support.PropertiesConverter; @@ -50,7 +51,9 @@ public class StepInstanceTests extends TestCase { public void testGetStreamContext() { assertNotNull(instance.getStreamContext()); assertTrue(instance.getStreamContext().getProperties().isEmpty()); - instance.setStreamContext(new StreamContext(PropertiesConverter.stringToProperties("foo=bar"))); + ExecutionAttributes executionAttributes = new ExecutionAttributes(); + executionAttributes.putString("foo", "bar"); + instance.setStreamContext(executionAttributes); assertEquals("bar", instance.getStreamContext().getProperties().getProperty("foo")); }