diff --git a/dictionary.txt b/dictionary.txt
index c97425432..90d2baced 100644
--- a/dictionary.txt
+++ b/dictionary.txt
@@ -93,3 +93,4 @@ proxied
payloads
unflushed
memento
+michael
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java b/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java
index 2d26a4a22..53cd33e1b 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,11 +25,12 @@ import org.springframework.util.ClassUtils;
* from another should subclass from Entity. More information on this pattern
* and the difference between Entities and Value Objects can be found in Domain
* Driven Design by Eric Evans.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
- *
+ *
*/
+@SuppressWarnings("serial")
public class Entity implements Serializable {
private Long id;
@@ -42,7 +43,7 @@ public class Entity implements Serializable {
public Entity(Long id) {
super();
-
+
//Commented out because StepExecutions are still created in a disconnected
//manner. The Repository should create them, then this can be uncommented.
//Assert.notNull(id, "Entity id must not be null.");
@@ -63,7 +64,7 @@ public class Entity implements Serializable {
public Integer getVersion() {
return version;
}
-
+
/**
* Public setter for the version needed only by repository methods.
* @param version the version to set
@@ -91,7 +92,7 @@ public class Entity implements Serializable {
/**
* Attempt to establish identity based on id if both exist. If either id
* does not exist use Object.equals().
- *
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
@@ -121,10 +122,10 @@ public class Entity implements Serializable {
* {@link Entity} after it is saved. Spring Batch does not store any of its
* entities in Sets as a matter of course, so internally this is consistent.
* Clients should not be exposed to unsaved entities.
- *
+ *
* @see java.lang.Object#hashCode()
*/
- @Override
+ @Override
public int hashCode() {
if (id == null) {
return super.hashCode();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java
index d0dc8980f..66225cdef 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,12 +24,13 @@ import org.springframework.util.StringUtils;
/**
* Value object used to carry information about the status of a
* job or step execution.
- *
+ *
* ExitStatus is immutable and therefore thread-safe.
- *
+ *
* @author Dave Syer
- *
+ *
*/
+@SuppressWarnings("serial")
public class ExitStatus implements Serializable, Comparable {
/**
@@ -85,7 +86,7 @@ public class ExitStatus implements Serializable, Comparable {
/**
* Getter for the exit code (defaults to blank).
- *
+ *
* @return the exit code.
*/
public String getExitCode() {
@@ -106,7 +107,7 @@ public class ExitStatus implements Serializable, Comparable {
* case of equal severity, the exit code is replaced if the new value is
* alphabetically greater.
*
- *
+ *
* Severity is defined by the exit code:
*
* - Codes beginning with EXECUTING have severity 1
@@ -117,9 +118,9 @@ public class ExitStatus implements Serializable, Comparable {
* - Codes beginning with UNKNOWN have severity 6
*
* Others have severity 7, so custom exit codes always win.
- *
+ *
* If the input is null just return this.
- *
+ *
* @param status an {@link ExitStatus} to combine with this one.
* @return a new {@link ExitStatus} combining the current value and the
* argument provided.
@@ -134,12 +135,12 @@ public class ExitStatus implements Serializable, Comparable {
}
return result;
}
-
+
/**
* @param status an {@link ExitStatus} to compare
* @return 1,0,-1 according to the severity and exit code
*/
- @Override
+ @Override
public int compareTo(ExitStatus status) {
if (severity(status) > severity(this)) {
return -1;
@@ -178,20 +179,20 @@ public class ExitStatus implements Serializable, Comparable {
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#toString()
*/
- @Override
+ @Override
public String toString() {
return String.format("exitCode=%s;exitDescription=%s", exitCode, exitDescription);
}
/**
* Compare the fields one by one.
- *
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
- @Override
+ @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
@@ -201,10 +202,10 @@ public class ExitStatus implements Serializable, Comparable {
/**
* Compatible with the equals implementation.
- *
+ *
* @see java.lang.Object#hashCode()
*/
- @Override
+ @Override
public int hashCode() {
return toString().hashCode();
}
@@ -212,7 +213,7 @@ public class ExitStatus implements Serializable, Comparable {
/**
* Add an exit code to an existing {@link ExitStatus}. If there is already a
* code present tit will be replaced.
- *
+ *
* @param code the code to add
* @return a new {@link ExitStatus} with the same properties but a new exit
* code.
@@ -223,7 +224,7 @@ public class ExitStatus implements Serializable, Comparable {
/**
* Check if this status represents a running process.
- *
+ *
* @return true if the exit code is "RUNNING" or "UNKNOWN"
*/
public boolean isRunning() {
@@ -234,7 +235,7 @@ public class ExitStatus implements Serializable, Comparable {
* Add an exit description to an existing {@link ExitStatus}. If there is
* already a description present the two will be concatenated with a
* semicolon.
- *
+ *
* @param description the description to add
* @return a new {@link ExitStatus} with the same properties but a new exit
* description
@@ -257,7 +258,7 @@ public class ExitStatus implements Serializable, Comparable {
/**
* Extract the stack trace from the throwable provided and append it to
* the exist description.
- *
+ *
* @param throwable
* @return a new ExitStatus with the stack trace appended
*/
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java
index 7603e45bf..9d7b50a20 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,10 +32,11 @@ import org.springframework.batch.item.ExecutionContext;
/**
* Batch domain object representing the execution of a job.
- *
+ *
* @author Lucas Ward
- *
+ *
*/
+@SuppressWarnings("serial")
public class JobExecution extends Entity {
private JobInstance jobInstance;
@@ -61,7 +62,7 @@ public class JobExecution extends Entity {
/**
* Because a JobExecution isn't valid unless the job is set, this
* constructor is the only valid one from a modelling point of view.
- *
+ *
* @param job the job of which this execution is a part
*/
public JobExecution(JobInstance job, Long id) {
@@ -71,7 +72,7 @@ public class JobExecution extends Entity {
/**
* Constructor for transient (unsaved) instances.
- *
+ *
* @param job the enclosing {@link JobInstance}
*/
public JobExecution(JobInstance job) {
@@ -108,7 +109,7 @@ public class JobExecution extends Entity {
/**
* Set the value of the status field.
- *
+ *
* @param status the status to set
*/
public void setStatus(BatchStatus status) {
@@ -119,7 +120,7 @@ public class JobExecution extends Entity {
* Upgrade the status field if the provided value is greater than the
* existing one. Clients using this method to set the status can be sure
* that they don't overwrite a failed status with an successful one.
- *
+ *
* @param status the new status value
*/
public void upgradeStatus(BatchStatus status) {
@@ -129,7 +130,7 @@ public class JobExecution extends Entity {
/**
* Convenience getter for for the id of the enclosing job. Useful for DAO
* implementations.
- *
+ *
* @return the id of the enclosing job
*/
public Long getJobId() {
@@ -162,7 +163,7 @@ public class JobExecution extends Entity {
/**
* Accessor for the step executions.
- *
+ *
* @return the step executions that were registered
*/
public Collection getStepExecutions() {
@@ -201,7 +202,7 @@ public class JobExecution extends Entity {
/**
* Signal the {@link JobExecution} to stop. Iterates through the associated
* {@link StepExecution}s, calling {@link StepExecution#setTerminateOnly()}.
- *
+ *
*/
public void stop() {
for (StepExecution stepExecution : stepExecutions) {
@@ -212,7 +213,7 @@ public class JobExecution extends Entity {
/**
* Sets the {@link ExecutionContext} for this execution
- *
+ *
* @param executionContext the context
*/
public void setExecutionContext(ExecutionContext executionContext) {
@@ -222,7 +223,7 @@ public class JobExecution extends Entity {
/**
* Returns the {@link ExecutionContext} for this execution. The content is
* expected to be persisted after each step completion (successful or not).
- *
+ *
* @return the context
*/
public ExecutionContext getExecutionContext() {
@@ -255,7 +256,7 @@ public class JobExecution extends Entity {
/**
* Get the date representing the last time this JobExecution was updated in
* the JobRepository.
- *
+ *
* @return Date representing the last time this JobExecution was updated.
*/
public Date getLastUpdated() {
@@ -264,7 +265,7 @@ public class JobExecution extends Entity {
/**
* Set the last time this JobExecution was updated.
- *
+ *
* @param lastUpdated
*/
public void setLastUpdated(Date lastUpdated) {
@@ -277,7 +278,7 @@ public class JobExecution extends Entity {
/**
* Add the provided throwable to the failure exception list.
- *
+ *
* @param t
*/
public synchronized void addFailureException(Throwable t) {
@@ -287,7 +288,7 @@ public class JobExecution extends Entity {
/**
* Return all failure causing exceptions for this JobExecution, including
* step executions.
- *
+ *
* @return List containing all exceptions causing failure for
* this JobExecution.
*/
@@ -312,10 +313,10 @@ public class JobExecution extends Entity {
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.domain.Entity#toString()
*/
- @Override
+ @Override
public String toString() {
return super.toString()
+ String.format(", startTime=%s, endTime=%s, lastUpdated=%s, status=%s, exitStatus=%s, job=[%s]",
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java
index ab98c4919..1cd2fd2b4 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,15 +20,15 @@ package org.springframework.batch.core;
* Implementations can be stateful if they are careful to either ensure thread
* safety, or to use one instance of a listener per job, assuming that job
* instances themselves are not used by more than one thread.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public interface JobExecutionListener {
/**
* Callback before a job executes.
- *
+ *
* @param jobExecution the current {@link JobExecution}
*/
void beforeJob(JobExecution jobExecution);
@@ -37,7 +37,7 @@ public interface JobExecutionListener {
* Callback after completion of a job. Called after both both successful and
* failed executions. To perform logic on a particular status, use
* "if (jobExecution.getStatus() == BatchStatus.X)".
- *
+ *
* @param jobExecution the current {@link JobExecution}
*/
void afterJob(JobExecution jobExecution);
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java
index f9b7798bf..a1320dcda 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,20 +23,21 @@ import org.springframework.util.Assert;
* identity is given by the pair {@link Job} and {@link JobParameters}.
* JobInstance can be restarted multiple times in case of execution failure and
* it's lifecycle ends with first successful execution.
- *
+ *
* Trying to execute an existing JobIntance that has already completed
* successfully will result in error. Error will be raised also for an attempt
* to restart a failed JobInstance if the Job is not restartable.
- *
+ *
* @see Job
* @see JobParameters
* @see JobExecution
- *
+ *
* @author Lucas Ward
* @author Dave Syer
* @author Robert Kasanicky
- *
+ *
*/
+@SuppressWarnings("unchecked")
public class JobInstance extends Entity {
private final JobParameters jobParameters;
@@ -65,7 +66,7 @@ public class JobInstance extends Entity {
return jobName;
}
- @Override
+ @Override
public String toString() {
return super.toString() + ", JobParameters=[" + jobParameters + "]" + ", Job=[" + jobName + "]";
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java
index ea58bc929..6fc74b992 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,12 +22,13 @@ import java.util.Date;
/**
* Domain representation of a parameter to a batch job. Only the following types
* can be parameters: String, Long, Date, and Double.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
* @since 2.0
- *
+ *
*/
+@SuppressWarnings("serial")
public class JobParameter implements Serializable {
private final Object parameter;
@@ -44,7 +45,7 @@ public class JobParameter implements Serializable {
/**
* Construct a new JobParameter as a Long.
- *
+ *
* @param parameter
*/
public JobParameter(Long parameter) {
@@ -54,7 +55,7 @@ public class JobParameter implements Serializable {
/**
* Construct a new JobParameter as a Date.
- *
+ *
* @param parameter
*/
public JobParameter(Date parameter) {
@@ -64,7 +65,7 @@ public class JobParameter implements Serializable {
/**
* Construct a new JobParameter as a Double.
- *
+ *
* @param parameter
*/
public JobParameter(Double parameter) {
@@ -112,7 +113,7 @@ public class JobParameter implements Serializable {
: parameter.toString());
}
- @Override
+ @Override
public int hashCode() {
return 7 + 21 * (parameter == null ? parameterType.hashCode() : parameter.hashCode());
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java
index bbaba57dc..6bffd54f3 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,10 +20,11 @@ import java.io.Serializable;
/**
* Represents a contribution to a {@link StepExecution}, buffering changes until
* they can be applied at a chunk boundary.
- *
+ *
* @author Dave Syer
- *
+ *
*/
+@SuppressWarnings("serial")
public class StepContribution implements Serializable {
private volatile int readCount = 0;
@@ -51,7 +52,7 @@ public class StepContribution implements Serializable {
/**
* Set the {@link ExitStatus} for this contribution.
- *
+ *
* @param status
*/
public void setExitStatus(ExitStatus status) {
@@ -60,7 +61,7 @@ public class StepContribution implements Serializable {
/**
* Public getter for the status.
- *
+ *
* @return the {@link ExitStatus} for this contribution
*/
public ExitStatus getExitStatus() {
@@ -90,7 +91,7 @@ public class StepContribution implements Serializable {
/**
* Public access to the read counter.
- *
+ *
* @return the item counter.
*/
public int getReadCount() {
@@ -99,7 +100,7 @@ public class StepContribution implements Serializable {
/**
* Public access to the write counter.
- *
+ *
* @return the item counter.
*/
public int getWriteCount() {
@@ -153,7 +154,7 @@ public class StepContribution implements Serializable {
}
/**
- *
+ *
*/
public void incrementProcessSkipCount() {
processSkipCount++;
@@ -183,10 +184,10 @@ public class StepContribution implements Serializable {
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#toString()
*/
- @Override
+ @Override
public String toString() {
return "[StepContribution: read=" + readCount + ", written=" + writeCount + ", filtered=" + filterCount
+ ", readSkips=" + readSkipCount + ", writeSkips=" + writeSkipCount + ", processSkips="
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java
index 648a77ba3..07b20ffb7 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,11 +30,12 @@ import org.springframework.util.Assert;
* Batch domain object representation the execution of a step. Unlike
* {@link JobExecution}, there are additional properties related the processing
* of items such as commit count, etc.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
- *
+ *
*/
+@SuppressWarnings("serial")
public class StepExecution extends Entity {
private final JobExecution jobExecution;
@@ -75,7 +76,7 @@ public class StepExecution extends Entity {
/**
* Constructor with mandatory properties.
- *
+ *
* @param stepName the step to which this execution belongs
* @param jobExecution the current job execution
* @param id the id of this execution
@@ -90,7 +91,7 @@ public class StepExecution extends Entity {
/**
* Constructor that substitutes in null for the execution id
- *
+ *
* @param stepName the step to which this execution belongs
* @param jobExecution the current job execution
*/
@@ -103,7 +104,7 @@ public class StepExecution extends Entity {
/**
* Returns the {@link ExecutionContext} for this execution
- *
+ *
* @return the attributes
*/
public ExecutionContext getExecutionContext() {
@@ -112,7 +113,7 @@ public class StepExecution extends Entity {
/**
* Sets the {@link ExecutionContext} for this execution
- *
+ *
* @param executionContext the attributes
*/
public void setExecutionContext(ExecutionContext executionContext) {
@@ -121,7 +122,7 @@ public class StepExecution extends Entity {
/**
* Returns the current number of commits for this execution
- *
+ *
* @return the current number of commits
*/
public int getCommitCount() {
@@ -130,7 +131,7 @@ public class StepExecution extends Entity {
/**
* Sets the current number of commits for this execution
- *
+ *
* @param commitCount the current number of commits
*/
public void setCommitCount(int commitCount) {
@@ -139,7 +140,7 @@ public class StepExecution extends Entity {
/**
* Returns the time that this execution ended
- *
+ *
* @return the time that this execution ended
*/
public Date getEndTime() {
@@ -148,7 +149,7 @@ public class StepExecution extends Entity {
/**
* Sets the time that this execution ended
- *
+ *
* @param endTime the time that this execution ended
*/
public void setEndTime(Date endTime) {
@@ -157,7 +158,7 @@ public class StepExecution extends Entity {
/**
* Returns the current number of items read for this execution
- *
+ *
* @return the current number of items read for this execution
*/
public int getReadCount() {
@@ -166,7 +167,7 @@ public class StepExecution extends Entity {
/**
* Sets the current number of read items for this execution
- *
+ *
* @param readCount the current number of read items for this execution
*/
public void setReadCount(int readCount) {
@@ -175,7 +176,7 @@ public class StepExecution extends Entity {
/**
* Returns the current number of items written for this execution
- *
+ *
* @return the current number of items written for this execution
*/
public int getWriteCount() {
@@ -184,7 +185,7 @@ public class StepExecution extends Entity {
/**
* Sets the current number of written items for this execution
- *
+ *
* @param writeCount the current number of written items for this execution
*/
public void setWriteCount(int writeCount) {
@@ -193,7 +194,7 @@ public class StepExecution extends Entity {
/**
* Returns the current number of rollbacks for this execution
- *
+ *
* @return the current number of rollbacks for this execution
*/
public int getRollbackCount() {
@@ -202,7 +203,7 @@ public class StepExecution extends Entity {
/**
* Returns the current number of items filtered out of this execution
- *
+ *
* @return the current number of items filtered out of this execution
*/
public int getFilterCount() {
@@ -227,7 +228,7 @@ public class StepExecution extends Entity {
/**
* Gets the time this execution started
- *
+ *
* @return the time this execution started
*/
public Date getStartTime() {
@@ -236,7 +237,7 @@ public class StepExecution extends Entity {
/**
* Sets the time this execution started
- *
+ *
* @param startTime the time this execution started
*/
public void setStartTime(Date startTime) {
@@ -245,7 +246,7 @@ public class StepExecution extends Entity {
/**
* Returns the current status of this step
- *
+ *
* @return the current status of this step
*/
public BatchStatus getStatus() {
@@ -254,7 +255,7 @@ public class StepExecution extends Entity {
/**
* Sets the current status of this step
- *
+ *
* @param status the current status of this step
*/
public void setStatus(BatchStatus status) {
@@ -265,7 +266,7 @@ public class StepExecution extends Entity {
* Upgrade the status field if the provided value is greater than the
* existing one. Clients using this method to set the status can be sure
* that they don't overwrite a failed status with an successful one.
- *
+ *
* @param status the new status value
*/
public void upgradeStatus(BatchStatus status) {
@@ -281,7 +282,7 @@ public class StepExecution extends Entity {
/**
* Accessor for the job execution id.
- *
+ *
* @return the jobExecutionId
*/
public Long getJobExecutionId() {
@@ -307,7 +308,7 @@ public class StepExecution extends Entity {
/**
* Accessor for the execution context information of the enclosing job.
- *
+ *
* @return the {@link JobExecution} that was used to start this step
* execution.
*/
@@ -317,7 +318,7 @@ public class StepExecution extends Entity {
/**
* Factory method for {@link StepContribution}.
- *
+ *
* @return a new {@link StepContribution}
*/
public StepContribution createStepContribution() {
@@ -328,7 +329,7 @@ public class StepExecution extends Entity {
* On successful execution just before a chunk commit, this method should be
* called. Synchronizes access to the {@link StepExecution} so that changes
* are atomic.
- *
+ *
* @param contribution
*/
public synchronized void apply(StepContribution contribution) {
@@ -379,7 +380,7 @@ public class StepExecution extends Entity {
/**
* Convenience method to get the current job parameters.
- *
+ *
* @return the {@link JobParameters} from the enclosing job, or empty if
* that is null
*/
@@ -406,7 +407,7 @@ public class StepExecution extends Entity {
/**
* Set the number of records skipped on read
- *
+ *
* @param readSkipCount
*/
public void setReadSkipCount(int readSkipCount) {
@@ -415,7 +416,7 @@ public class StepExecution extends Entity {
/**
* Set the number of records skipped on write
- *
+ *
* @param writeSkipCount
*/
public void setWriteSkipCount(int writeSkipCount) {
@@ -431,7 +432,7 @@ public class StepExecution extends Entity {
/**
* Set the number of records skipped during processing.
- *
+ *
* @param processSkipCount
*/
public void setProcessSkipCount(int processSkipCount) {
@@ -447,7 +448,7 @@ public class StepExecution extends Entity {
/**
* Set the time when the StepExecution was last updated before persisting
- *
+ *
* @param lastUpdated
*/
public void setLastUpdated(Date lastUpdated) {
@@ -464,12 +465,12 @@ public class StepExecution extends Entity {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.container.common.domain.Entity#equals(java.
* lang.Object)
*/
- @Override
+ @Override
public boolean equals(Object obj) {
Object jobExecutionId = getJobExecutionId();
@@ -493,10 +494,10 @@ public class StepExecution extends Entity {
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.container.common.domain.Entity#hashCode()
*/
- @Override
+ @Override
public int hashCode() {
Object jobExecutionId = getJobExecutionId();
Long id = getId();
@@ -504,7 +505,7 @@ public class StepExecution extends Entity {
* (jobExecutionId != null ? jobExecutionId.hashCode() : 0) + 59 * (id != null ? id.hashCode() : 0);
}
- @Override
+ @Override
public String toString() {
return String.format(getSummary() + ", exitDescription=%s", exitStatus.getExitDescription());
}
@@ -514,8 +515,8 @@ public class StepExecution extends Entity {
+ String.format(
", name=%s, status=%s, exitStatus=%s, readCount=%d, filterCount=%d, writeCount=%d readSkipCount=%d, writeSkipCount=%d"
+ ", processSkipCount=%d, commitCount=%d, rollbackCount=%d", stepName, status,
- exitStatus.getExitCode(), readCount, filterCount, writeCount, readSkipCount, writeSkipCount,
- processSkipCount, commitCount, rollbackCount);
+ exitStatus.getExitCode(), readCount, filterCount, writeCount, readSkipCount, writeSkipCount,
+ processSkipCount, commitCount, rollbackCount);
}
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java
index f969e2409..04a668e6a 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecutionListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,17 +18,17 @@ package org.springframework.batch.core;
/**
* Listener interface for the lifecycle of a {@link Step}.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
- *
+ *
*/
public interface StepExecutionListener extends StepListener {
/**
* Initialize the state of the listener with the {@link StepExecution} from
* the current scope.
- *
+ *
* @param stepExecution
*/
void beforeStep(StepExecution stepExecution);
@@ -37,11 +37,11 @@ public interface StepExecutionListener extends StepListener {
* Give a listener a chance to modify the exit status from a step. The value
* returned will be combined with the normal exit status using
* {@link ExitStatus#and(ExitStatus)}.
- *
+ *
* Called after execution of step's processing logic (both successful or
* failed). Throwing exception in this method has no effect, it will only be
* logged.
- *
+ *
* @return an {@link ExitStatus} to combine with the normal value. Return
* null to leave the old value unchanged.
*/
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
index 1d0230850..1d5217946 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/ModularBatchConfiguration.java
@@ -31,7 +31,7 @@ import org.springframework.transaction.PlatformTransactionManager;
/**
* Base {@code Configuration} class providing common structure for enabling and using Spring Batch. Customization is
* available by implementing the {@link BatchConfigurer} interface.
- *
+ *
* @author Dave Syer
* @since 2.2
* @see EnableBatchProcessing
@@ -47,19 +47,19 @@ public class ModularBatchConfiguration extends AbstractBatchConfiguration {
private AutomaticJobRegistrar registrar = new AutomaticJobRegistrar();
- @Override
+ @Override
@Bean
public JobRepository jobRepository() throws Exception {
return getConfigurer(configurers).getJobRepository();
}
- @Override
+ @Override
@Bean
public JobLauncher jobLauncher() throws Exception {
return getConfigurer(configurers).getJobLauncher();
}
- @Override
+ @Override
@Bean
public PlatformTransactionManager transactionManager() throws Exception {
return getConfigurer(configurers).getTransactionManager();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
index c1952959a..b3310a267 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/SimpleBatchConfiguration.java
@@ -37,7 +37,7 @@ import org.springframework.transaction.PlatformTransactionManager;
* only initialize when a method is called. This is to prevent (as much as possible) configuration cycles from
* developing when these components are needed in a configuration resource that itself provides a
* {@link BatchConfigurer}.
- *
+ *
* @author Dave Syer
* @since 2.2
* @see EnableBatchProcessing
@@ -47,7 +47,7 @@ public class SimpleBatchConfiguration extends AbstractBatchConfiguration {
@Autowired
private ApplicationContext context;
-
+
private boolean initialized = false;
private AtomicReference jobRepository = new AtomicReference();
@@ -58,25 +58,25 @@ public class SimpleBatchConfiguration extends AbstractBatchConfiguration {
private AtomicReference transactionManager = new AtomicReference();
- @Override
+ @Override
@Bean
public JobRepository jobRepository() throws Exception {
return createLazyProxy(jobRepository, JobRepository.class);
}
- @Override
+ @Override
@Bean
public JobLauncher jobLauncher() throws Exception {
return createLazyProxy(jobLauncher, JobLauncher.class);
}
- @Override
+ @Override
@Bean
public JobRegistry jobRegistry() throws Exception {
return createLazyProxy(jobRegistry, JobRegistry.class);
}
- @Override
+ @Override
@Bean
public PlatformTransactionManager transactionManager() throws Exception {
return createLazyProxy(transactionManager, PlatformTransactionManager.class);
@@ -95,7 +95,7 @@ public class SimpleBatchConfiguration extends AbstractBatchConfiguration {
/**
* Sets up the basic components by extracting them from the {@link BatchConfigurer configurer}, defaulting to some
* sensible values as long as a unique DataSource is available.
- *
+ *
* @throws Exception if there is a problem in the configurer
*/
protected void initialize() throws Exception {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
index a489cb9af..125e3daa9 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ApplicationContextJobFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,9 +23,9 @@ import org.springframework.context.ConfigurableApplicationContext;
/**
* A {@link JobFactory} that creates its own {@link ApplicationContext} and
* pulls a bean out when asked to create a {@link Job}.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class ApplicationContextJobFactory implements JobFactory {
@@ -39,26 +39,26 @@ public class ApplicationContextJobFactory implements JobFactory {
*/
public ApplicationContextJobFactory(String jobName, ApplicationContextFactory applicationContextFactory) {
ConfigurableApplicationContext context = applicationContextFactory.createApplicationContext();
- this.job = (Job) context.getBean(jobName, Job.class);
+ this.job = context.getBean(jobName, Job.class);
}
/**
* Create an {@link ApplicationContext} from the factory provided and pull
* out a bean with the name given during initialization.
- *
+ *
* @see org.springframework.batch.core.configuration.JobFactory#createJob()
*/
- @Override
+ @Override
public final Job createJob() {
return job;
}
-
+
/**
* Just return the name of instance passed in on initialization.
- *
+ *
* @see JobFactory#getJobName()
*/
- @Override
+ @Override
public String getJobName() {
return job.getName();
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
index 228a0ee98..cf3bc97db 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/DefaultJobLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2010 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
private static Log logger = LogFactory.getLog(DefaultJobLoader.class);
private JobRegistry jobRegistry;
- private StepRegistry stepRegistry;
+ private StepRegistry stepRegistry;
private Map contexts = new ConcurrentHashMap();
@@ -63,24 +63,24 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
this(null, null);
}
- /**
- * Creates a job loader with the job registry provided.
- *
- * @param jobRegistry a {@link JobRegistry}
- */
- public DefaultJobLoader(JobRegistry jobRegistry) {
- this(jobRegistry, null);
- }
+ /**
+ * Creates a job loader with the job registry provided.
+ *
+ * @param jobRegistry a {@link JobRegistry}
+ */
+ public DefaultJobLoader(JobRegistry jobRegistry) {
+ this(jobRegistry, null);
+ }
/**
* Creates a job loader with the job and step registries provided.
- *
+ *
* @param jobRegistry a {@link JobRegistry}
- * @param stepRegistry a {@link StepRegistry}
+ * @param stepRegistry a {@link StepRegistry}
*/
public DefaultJobLoader(JobRegistry jobRegistry, StepRegistry stepRegistry) {
this.jobRegistry = jobRegistry;
- this.stepRegistry = stepRegistry;
+ this.stepRegistry = stepRegistry;
}
/**
@@ -92,14 +92,14 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
this.jobRegistry = jobRegistry;
}
- /**
- * The {@link StepRegistry} to use for the steps of created jobs.
- *
- * @param stepRegistry the step registry
- */
- public void setStepRegistry(StepRegistry stepRegistry) {
- this.stepRegistry = stepRegistry;
- }
+ /**
+ * The {@link StepRegistry} to use for the steps of created jobs.
+ *
+ * @param stepRegistry the step registry
+ */
+ public void setStepRegistry(StepRegistry stepRegistry) {
+ this.stepRegistry = stepRegistry;
+ }
/**
* Unregister all the jobs and close all the contexts created by this
@@ -107,7 +107,7 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
*
* @see JobLoader#clear()
*/
- @Override
+ @Override
public void clear() {
for (ConfigurableApplicationContext context : contexts.values()) {
if (context.isActive()) {
@@ -115,12 +115,12 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
}
}
for (String jobName : jobRegistry.getJobNames()) {
- doUnregister(jobName);
+ doUnregister(jobName);
}
contexts.clear();
}
- @Override
+ @Override
public Collection reload(ApplicationContextFactory factory) {
// If the same factory is loaded twice the context can be closed
@@ -142,7 +142,7 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
}
}
- @Override
+ @Override
public Collection load(ApplicationContextFactory factory) throws DuplicateJobException {
return doLoad(factory, false);
}
@@ -205,74 +205,74 @@ public class DefaultJobLoader implements JobLoader, InitializingBean {
}
- /**
- * Returns all the {@link Step} instances defined by the specified {@link StepLocator}.
- *
- * The specified jobApplicationContext is used to collect additional steps that
- * are not exposed by the step locator
- *
- * @param stepLocator the given step locator
- * @param jobApplicationContext the application context of the job
- * @return all the {@link Step} defined by the given step locator and context
- * @see StepLocator
- */
- private Collection getSteps(final StepLocator stepLocator, final ApplicationContext jobApplicationContext) {
- final Collection stepNames = stepLocator.getStepNames();
- final Collection result = new ArrayList();
- for (String stepName : stepNames) {
- result.add(stepLocator.getStep(stepName));
- }
+ /**
+ * Returns all the {@link Step} instances defined by the specified {@link StepLocator}.
+ *
+ * The specified jobApplicationContext is used to collect additional steps that
+ * are not exposed by the step locator
+ *
+ * @param stepLocator the given step locator
+ * @param jobApplicationContext the application context of the job
+ * @return all the {@link Step} defined by the given step locator and context
+ * @see StepLocator
+ */
+ private Collection getSteps(final StepLocator stepLocator, final ApplicationContext jobApplicationContext) {
+ final Collection stepNames = stepLocator.getStepNames();
+ final Collection result = new ArrayList();
+ for (String stepName : stepNames) {
+ result.add(stepLocator.getStep(stepName));
+ }
- // Because some steps are referenced by name, we need to look in the context to see if there
- // are more Step instances defined. Right now they are registered as being available in the
- // context of the job but we have no idea if they are linked to that Job or not.
- @SuppressWarnings("unchecked")
- final Map allSteps = jobApplicationContext.getBeansOfType(Step.class);
- for (Map.Entry entry : allSteps.entrySet()) {
- if (!stepNames.contains(entry.getKey())) {
- result.add(entry.getValue());
- }
- }
- return result;
- }
+ // Because some steps are referenced by name, we need to look in the context to see if there
+ // are more Step instances defined. Right now they are registered as being available in the
+ // context of the job but we have no idea if they are linked to that Job or not.
+ @SuppressWarnings("unchecked")
+ final Map allSteps = jobApplicationContext.getBeansOfType(Step.class);
+ for (Map.Entry entry : allSteps.entrySet()) {
+ if (!stepNames.contains(entry.getKey())) {
+ result.add(entry.getValue());
+ }
+ }
+ return result;
+ }
- /**
- * Registers the specified {@link Job} defined in the specified {@link ConfigurableApplicationContext}.
- *
- * Makes sure to update the {@link StepRegistry} if it is available.
- *
- * @param context the context in which the job is defined
- * @param job the job to register
- * @throws DuplicateJobException if that job is already registered
- */
- private void doRegister(ConfigurableApplicationContext context, Job job) throws DuplicateJobException {
- final JobFactory jobFactory = new ReferenceJobFactory(job);
- jobRegistry.register(jobFactory);
+ /**
+ * Registers the specified {@link Job} defined in the specified {@link ConfigurableApplicationContext}.
+ *
+ * Makes sure to update the {@link StepRegistry} if it is available.
+ *
+ * @param context the context in which the job is defined
+ * @param job the job to register
+ * @throws DuplicateJobException if that job is already registered
+ */
+ private void doRegister(ConfigurableApplicationContext context, Job job) throws DuplicateJobException {
+ final JobFactory jobFactory = new ReferenceJobFactory(job);
+ jobRegistry.register(jobFactory);
- if (stepRegistry != null) {
- if (!(job instanceof StepLocator)) {
- throw new UnsupportedOperationException("Cannot locate steps from a Job that is not a StepLocator: job="
- + job.getName() + " does not implement StepLocator");
- }
- stepRegistry.register(job.getName(), getSteps((StepLocator) job, context));
- }
- }
+ if (stepRegistry != null) {
+ if (!(job instanceof StepLocator)) {
+ throw new UnsupportedOperationException("Cannot locate steps from a Job that is not a StepLocator: job="
+ + job.getName() + " does not implement StepLocator");
+ }
+ stepRegistry.register(job.getName(), getSteps((StepLocator) job, context));
+ }
+ }
- /**
- * Unregisters the job identified by the specified jobName.
- *
- * @param jobName the name of the job to unregister
- */
- private void doUnregister(String jobName) {
- jobRegistry.unregister(jobName);
- if (stepRegistry != null) {
- stepRegistry.unregisterStepsFromJob(jobName);
- }
+ /**
+ * Unregisters the job identified by the specified jobName.
+ *
+ * @param jobName the name of the job to unregister
+ */
+ private void doUnregister(String jobName) {
+ jobRegistry.unregister(jobName);
+ if (stepRegistry != null) {
+ stepRegistry.unregisterStepsFromJob(jobName);
+ }
- }
+ }
- @Override
- public void afterPropertiesSet() {
- Assert.notNull(jobRegistry, "Job registry could not be null.");
- }
+ @Override
+ public void afterPropertiesSet() {
+ Assert.notNull(jobRegistry, "Job registry could not be null.");
+ }
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java
index 9a7cbbf22..be40fc985 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/GroupAwareJob.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,10 +29,10 @@ import org.springframework.util.ClassUtils;
* identical functionality but named financeDepartment.overnightJob
* . The use of a "." separator for elements is deliberate, since it is a "safe"
* character in a URL.
- *
- *
+ *
+ *
* @author Dave Syer
- *
+ *
*/
public class GroupAwareJob implements Job {
@@ -48,7 +48,7 @@ public class GroupAwareJob implements Job {
/**
* Create a new {@link Job} with the delegate and no group name.
- *
+ *
* @param delegate a delegate for the features of a regular Job
*/
public GroupAwareJob(Job delegate) {
@@ -57,7 +57,7 @@ public class GroupAwareJob implements Job {
/**
* Create a new {@link Job} with the given group name and delegate.
- *
+ *
* @param groupName the group name to prepend
* @param delegate a delegate for the features of a regular Job
*/
@@ -67,40 +67,40 @@ public class GroupAwareJob implements Job {
this.delegate = delegate;
}
- @Override
+ @Override
public void execute(JobExecution execution) {
delegate.execute(execution);
}
-
+
/**
* Concatenates the group name and the delegate job name (joining with a
* ".").
- *
+ *
* @see org.springframework.batch.core.Job#getName()
*/
- @Override
+ @Override
public String getName() {
return groupName==null ? delegate.getName() : groupName + SEPARATOR + delegate.getName();
}
- @Override
+ @Override
public boolean isRestartable() {
return delegate.isRestartable();
}
- @Override
+ @Override
public JobParametersIncrementer getJobParametersIncrementer() {
return delegate.getJobParametersIncrementer();
}
- @Override
+ @Override
public JobParametersValidator getJobParametersValidator() {
return delegate.getJobParametersValidator();
}
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
@@ -113,14 +113,14 @@ public class GroupAwareJob implements Job {
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return delegate.hashCode();
}
-
+
@Override
public String toString() {
return ClassUtils.getShortName(delegate.getClass()) + ": [name=" + getName() + "]";
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java
index 59cf3f266..643e9c439 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/JobRegistryBeanPostProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,12 +40,12 @@ import org.springframework.util.Assert;
* {@link JobRegistry}. Include a bean of this type along with your job
* configuration, and use the same {@link JobRegistry} as a {@link JobLocator}
* when you need to locate a {@link Job} to launch.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFactoryAware, InitializingBean,
- DisposableBean {
+DisposableBean {
private static Log logger = LogFactory.getLog(JobRegistryBeanPostProcessor.class);
@@ -65,7 +65,7 @@ public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFact
* contributing to the same {@link JobRegistry}: child contexts can then
* define an instance with a unique group name to avoid clashes between job
* names.
- *
+ *
* @param groupName the groupName to set
*/
public void setGroupName(String groupName) {
@@ -74,7 +74,7 @@ public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFact
/**
* Injection setter for {@link JobRegistry}.
- *
+ *
* @param jobRegistry the jobConfigurationRegistry to set
*/
public void setJobRegistry(JobRegistry jobRegistry) {
@@ -83,12 +83,12 @@ public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFact
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org
* .springframework.beans.factory.BeanFactory)
*/
- @Override
+ @Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
if (beanFactory instanceof DefaultListableBeanFactory) {
this.beanFactory = (DefaultListableBeanFactory) beanFactory;
@@ -97,10 +97,10 @@ public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFact
/**
* Make sure the registry is set before use.
- *
+ *
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(jobRegistry, "JobRegistry must not be null");
}
@@ -110,7 +110,7 @@ public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFact
* post processor.
* @see org.springframework.beans.factory.DisposableBean#destroy()
*/
- @Override
+ @Override
public void destroy() throws Exception {
for (String name : jobNames) {
logger.debug("Unregistering job: " + name);
@@ -122,11 +122,11 @@ public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFact
/**
* If the bean is an instance of {@link Job} then register it.
* @throws FatalBeanException if there is a {@link DuplicateJobException}.
- *
+ *
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object,
* java.lang.String)
*/
- @Override
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof Job) {
Job job = (Job) bean;
@@ -154,7 +154,7 @@ public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFact
* Determine a group name for the job to be registered. Default
* implementation just returns the {@link #setGroupName(String) groupName}
* configured. Provides an extension point for specialised subclasses.
- *
+ *
* @param beanDefinition the bean definition for the job
* @param job the job
* @return a group name for the job (or null if not needed)
@@ -165,11 +165,11 @@ public class JobRegistryBeanPostProcessor implements BeanPostProcessor, BeanFact
/**
* Do nothing.
- *
+ *
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object,
* java.lang.String)
*/
- @Override
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapJobRegistry.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapJobRegistry.java
index f97c26ece..9cd93cb54 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapJobRegistry.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapJobRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,11 @@
*/
package org.springframework.batch.core.configuration.support;
+import java.util.Collections;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
import org.springframework.batch.core.Job;
import org.springframework.batch.core.configuration.DuplicateJobException;
import org.springframework.batch.core.configuration.JobFactory;
@@ -22,11 +27,6 @@ import org.springframework.batch.core.configuration.JobRegistry;
import org.springframework.batch.core.launch.NoSuchJobException;
import org.springframework.util.Assert;
-import java.util.Collections;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
/**
* Simple, thread-safe, map-based implementation of {@link JobRegistry}.
*
@@ -35,46 +35,46 @@ import java.util.concurrent.ConcurrentMap;
*/
public class MapJobRegistry implements JobRegistry {
- /**
- * The map holding the registered job factories.
- */
- // The "final" ensures that it is visible and initialized when the constructor resolves.
- private final ConcurrentMap map = new ConcurrentHashMap();
+ /**
+ * The map holding the registered job factories.
+ */
+ // The "final" ensures that it is visible and initialized when the constructor resolves.
+ private final ConcurrentMap map = new ConcurrentHashMap();
- @Override
- public void register(JobFactory jobFactory) throws DuplicateJobException {
- Assert.notNull(jobFactory);
- String name = jobFactory.getJobName();
- Assert.notNull(name, "Job configuration must have a name.");
- JobFactory previousValue = map.putIfAbsent(name, jobFactory);
- if (previousValue != null) {
- throw new DuplicateJobException("A job configuration with this name [" + name
- + "] was already registered");
- }
- }
+ @Override
+ public void register(JobFactory jobFactory) throws DuplicateJobException {
+ Assert.notNull(jobFactory);
+ String name = jobFactory.getJobName();
+ Assert.notNull(name, "Job configuration must have a name.");
+ JobFactory previousValue = map.putIfAbsent(name, jobFactory);
+ if (previousValue != null) {
+ throw new DuplicateJobException("A job configuration with this name [" + name
+ + "] was already registered");
+ }
+ }
- @Override
- public void unregister(String name) {
- Assert.notNull(name, "Job configuration must have a name.");
- map.remove(name);
- }
+ @Override
+ public void unregister(String name) {
+ Assert.notNull(name, "Job configuration must have a name.");
+ map.remove(name);
+ }
- @Override
- public Job getJob(String name) throws NoSuchJobException {
- JobFactory factory = map.get(name);
- if (factory == null) {
- throw new NoSuchJobException("No job configuration with the name [" + name + "] was registered");
- } else {
- return factory.createJob();
- }
- }
+ @Override
+ public Job getJob(String name) throws NoSuchJobException {
+ JobFactory factory = map.get(name);
+ if (factory == null) {
+ throw new NoSuchJobException("No job configuration with the name [" + name + "] was registered");
+ } else {
+ return factory.createJob();
+ }
+ }
- /**
- * Provides an unmodifiable view of the job names.
- */
- @Override
- public Set getJobNames() {
- return Collections.unmodifiableSet(map.keySet());
- }
+ /**
+ * Provides an unmodifiable view of the job names.
+ */
+ @Override
+ public Set getJobNames() {
+ return Collections.unmodifiableSet(map.keySet());
+ }
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java
index 0fc7ca50c..fea8816e7 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/MapStepRegistry.java
@@ -1,5 +1,26 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.batch.core.configuration.support;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.DuplicateJobException;
import org.springframework.batch.core.configuration.StepRegistry;
@@ -7,12 +28,6 @@ import org.springframework.batch.core.launch.NoSuchJobException;
import org.springframework.batch.core.step.NoSuchStepException;
import org.springframework.util.Assert;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
/**
* Simple map-based implementation of {@link StepRegistry}. Access to the map is
* synchronized, guarded by an internal lock.
@@ -22,46 +37,46 @@ import java.util.concurrent.ConcurrentMap;
*/
public class MapStepRegistry implements StepRegistry {
- private final ConcurrentMap> map = new ConcurrentHashMap>();
+ private final ConcurrentMap> map = new ConcurrentHashMap>();
- @Override
- public void register(String jobName, Collection steps) throws DuplicateJobException {
- Assert.notNull(jobName, "The job name cannot be null.");
- Assert.notNull(steps, "The job steps cannot be null.");
+ @Override
+ public void register(String jobName, Collection steps) throws DuplicateJobException {
+ Assert.notNull(jobName, "The job name cannot be null.");
+ Assert.notNull(steps, "The job steps cannot be null.");
- final Map jobSteps = new HashMap();
- for (Step step : steps) {
- jobSteps.put(step.getName(), step);
- }
- final Object previousValue = map.putIfAbsent(jobName, jobSteps);
- if (previousValue != null) {
- throw new DuplicateJobException("A job configuration with this name [" + jobName
- + "] was already registered");
- }
- }
+ final Map jobSteps = new HashMap();
+ for (Step step : steps) {
+ jobSteps.put(step.getName(), step);
+ }
+ final Object previousValue = map.putIfAbsent(jobName, jobSteps);
+ if (previousValue != null) {
+ throw new DuplicateJobException("A job configuration with this name [" + jobName
+ + "] was already registered");
+ }
+ }
- @Override
- public void unregisterStepsFromJob(String jobName) {
- Assert.notNull(jobName, "Job configuration must have a name.");
- map.remove(jobName);
- }
+ @Override
+ public void unregisterStepsFromJob(String jobName) {
+ Assert.notNull(jobName, "Job configuration must have a name.");
+ map.remove(jobName);
+ }
- @Override
- public Step getStep(String jobName, String stepName) throws NoSuchJobException {
- Assert.notNull(jobName, "The job name cannot be null.");
- Assert.notNull(stepName, "The step name cannot be null.");
- if (!map.containsKey(jobName)) {
- throw new NoSuchJobException("No job configuration with the name [" + jobName + "] was registered");
- } else {
- final Map jobSteps = map.get(jobName);
- if (jobSteps.containsKey(stepName)) {
- return jobSteps.get(stepName);
- } else {
- throw new NoSuchStepException("The step called [" + stepName + "] does not exist in the job [" +
- jobName + "]");
- }
- }
- }
+ @Override
+ public Step getStep(String jobName, String stepName) throws NoSuchJobException {
+ Assert.notNull(jobName, "The job name cannot be null.");
+ Assert.notNull(stepName, "The step name cannot be null.");
+ if (!map.containsKey(jobName)) {
+ throw new NoSuchJobException("No job configuration with the name [" + jobName + "] was registered");
+ } else {
+ final Map jobSteps = map.get(jobName);
+ if (jobSteps.containsKey(stepName)) {
+ return jobSteps.get(stepName);
+ } else {
+ throw new NoSuchStepException("The step called [" + stepName + "] does not exist in the job [" +
+ jobName + "]");
+ }
+ }
+ }
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/OsgiBundleXmlApplicationContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/OsgiBundleXmlApplicationContextFactory.java
index df4d62484..82c2942fa 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/OsgiBundleXmlApplicationContextFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/OsgiBundleXmlApplicationContextFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,12 +27,12 @@ import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
/**
* {@link ApplicationContextFactory} that can be used to load a context from an
* XML location in a bundle.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class OsgiBundleXmlApplicationContextFactory implements BundleContextAware, ApplicationContextFactory,
- ApplicationContextAware {
+ApplicationContextAware {
private BundleContext bundleContext;
@@ -58,10 +58,10 @@ public class OsgiBundleXmlApplicationContextFactory implements BundleContextAwar
/**
* Setter for the parent application context.
- *
+ *
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/
- @Override
+ @Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
parent = applicationContext;
}
@@ -69,10 +69,10 @@ public class OsgiBundleXmlApplicationContextFactory implements BundleContextAwar
/**
* Stash the {@link BundleContext} for creating a job application context
* later.
- *
+ *
* @see org.springframework.osgi.context.BundleContextAware#setBundleContext(org.osgi.framework.BundleContext)
*/
- @Override
+ @Override
public void setBundleContext(BundleContext context) {
this.bundleContext = context;
}
@@ -81,10 +81,10 @@ public class OsgiBundleXmlApplicationContextFactory implements BundleContextAwar
* Create an application context from the provided path, using the current
* OSGi {@link BundleContext} and the enclosing Spring
* {@link ApplicationContext} as a parent context.
- *
+ *
* @see ApplicationContextFactory#createApplicationContext()
*/
- @Override
+ @Override
public ConfigurableApplicationContext createApplicationContext() {
OsgiBundleXmlApplicationContext context = new OsgiBundleXmlApplicationContext(new String[] { path }, parent);
String displayName = bundleContext.getBundle().getSymbolicName() + ":" + this.displayName;
@@ -108,10 +108,12 @@ public class OsgiBundleXmlApplicationContextFactory implements BundleContextAwar
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj) {
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
+ }
return toString().equals(obj.toString());
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java
index 066f6d013..0427aebe3 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ReferenceJobFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,9 +21,9 @@ import org.springframework.batch.core.configuration.JobFactory;
/**
* A {@link JobFactory} that just keeps a reference to a {@link Job}. It never
* modifies its {@link Job}.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class ReferenceJobFactory implements JobFactory {
@@ -38,20 +38,20 @@ public class ReferenceJobFactory implements JobFactory {
/**
* Just return the instance passed in on initialization.
- *
+ *
* @see JobFactory#createJob()
*/
- @Override
+ @Override
public final Job createJob() {
return job;
}
-
+
/**
* Just return the name of instance passed in on initialization.
- *
+ *
* @see JobFactory#getJobName()
*/
- @Override
+ @Override
public String getJobName() {
return job.getName();
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceHandler.java
index ba486af05..53890ac24 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceHandler.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespaceHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,17 +19,17 @@ import org.springframework.beans.factory.xml.NamespaceHandler;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
/**
- *
+ *
*
* @author Dave Syer
- *
+ *
*/
public class CoreNamespaceHandler extends NamespaceHandlerSupport {
/**
* @see NamespaceHandler#init()
*/
- @Override
+ @Override
public void init() {
this.registerBeanDefinitionParser("job", new JobParser());
this.registerBeanDefinitionParser("flow", new TopLevelFlowParser());
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespacePostProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespacePostProcessor.java
index b3d44f246..e7223c8fa 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespacePostProcessor.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/CoreNamespacePostProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2009 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ import org.springframework.transaction.PlatformTransactionManager;
/**
* Post-process jobs and steps defined using the batch namespace to inject
* dependencies.
- *
+ *
* @author Dan Garrette
* @since 2.0.1
*/
@@ -49,7 +49,7 @@ public class CoreNamespacePostProcessor implements BeanPostProcessor, BeanFactor
private ApplicationContext applicationContext;
- @Override
+ @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
for (String beanName : beanFactory.getBeanDefinitionNames()) {
injectJobRepositoryIntoSteps(beanName, beanFactory);
@@ -60,7 +60,7 @@ public class CoreNamespacePostProcessor implements BeanPostProcessor, BeanFactor
/**
* Automatically inject job-repository from a job into its steps. Only
* inject if the step is an AbstractStep or StepParserStepFactoryBean.
- *
+ *
* @param beanName
* @param beanFactory
*/
@@ -89,7 +89,7 @@ public class CoreNamespacePostProcessor implements BeanPostProcessor, BeanFactor
* If any of the beans in the parent hierarchy is a <step/> with a
* <tasklet/>, then the bean class must be
* {@link StepParserStepFactoryBean}.
- *
+ *
* @param beanName
* @param beanFactory
*/
@@ -102,7 +102,7 @@ public class CoreNamespacePostProcessor implements BeanPostProcessor, BeanFactor
}
}
- @Override
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return injectDefaults(bean);
}
@@ -115,7 +115,7 @@ public class CoreNamespacePostProcessor implements BeanPostProcessor, BeanFactor
* Inject "transactionManager" into any
* {@link StepParserStepFactoryBean} without a transactionManager.
*
- *
+ *
* @param bean
* @return
*/
@@ -142,12 +142,12 @@ public class CoreNamespacePostProcessor implements BeanPostProcessor, BeanFactor
return bean;
}
- @Override
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
- @Override
+ @Override
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java
index 8da10a252..7065b75f6 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobExecutionListenerParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,19 +24,19 @@ import org.springframework.batch.core.listener.ListenerMetaData;
/**
* Parser for a step listener element. Builds a {@link JobListenerFactoryBean}
* using attributes from the configuration.
- *
+ *
* @author Dan Garrette
* @since 2.0
* @see AbstractListenerParser
*/
public class JobExecutionListenerParser extends AbstractListenerParser {
- @Override
+ @Override
protected Class extends AbstractListenerFactoryBean> getBeanClass() {
return JobListenerFactoryBean.class;
}
- @Override
+ @Override
protected ListenerMetaData[] getMetaDataValues() {
return JobListenerMetaData.values();
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParserJobFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParserJobFactoryBean.java
index 07d46cabd..202281f63 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParserJobFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParserJobFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2009 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ import org.springframework.util.StringUtils;
* This {@link FactoryBean} is used by the batch namespace parser to create
* {@link FlowJob} objects. It stores all of the properties that are
* configurable on the <job/>.
- *
+ *
* @author Dan Garrette
* @author Dave Syer
* @since 2.0.1
@@ -55,7 +55,7 @@ class JobParserJobFactoryBean implements SmartFactoryBean {
this.name = name;
}
- @Override
+ @Override
public final Object getObject() throws Exception {
Assert.isTrue(StringUtils.hasText(name), "The job must have an id.");
FlowJob flowJob = new FlowJob(name);
@@ -95,7 +95,7 @@ class JobParserJobFactoryBean implements SmartFactoryBean {
public void setJobRepository(JobRepository jobRepository) {
this.jobRepository = jobRepository;
}
-
+
public void setJobParametersValidator(JobParametersValidator jobParametersValidator) {
this.jobParametersValidator = jobParametersValidator;
}
@@ -116,22 +116,22 @@ class JobParserJobFactoryBean implements SmartFactoryBean {
this.flow = flow;
}
- @Override
+ @Override
public Class getObjectType() {
return FlowJob.class;
}
- @Override
+ @Override
public boolean isSingleton() {
return true;
}
-
- @Override
+
+ @Override
public boolean isEagerInit() {
return true;
}
-
- @Override
+
+ @Override
public boolean isPrototype() {
return false;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java
index bc396928f..b963d1d05 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/SimpleFlowFactoryBean.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.batch.core.configuration.xml;
import java.util.ArrayList;
@@ -23,10 +38,11 @@ import org.springframework.util.Assert;
* replaces the states in the input with proxies that have a unique name formed
* from the flow name and the original state name (unless the name is already in
* that form, in which case it is not modified).
- *
+ *
* @author Dave Syer
- *
+ *
*/
+@SuppressWarnings("rawtypes")
public class SimpleFlowFactoryBean implements FactoryBean, InitializingBean {
private String name;
@@ -37,7 +53,7 @@ public class SimpleFlowFactoryBean implements FactoryBean, InitializingBean {
/**
* The name of the flow that is created by this factory.
- *
+ *
* @param name the value of the name
*/
public void setName(String name) {
@@ -47,10 +63,10 @@ public class SimpleFlowFactoryBean implements FactoryBean, InitializingBean {
/**
* The raw state transitions for the flow. They will be transformed into
- * proxies that have the same behaviour but unique names prefixed with the
+ * proxies that have the same behavior but unique names prefixed with the
* flow name.
- *
- * @param name the value of the name
+ *
+ * @param stateTransitions the list of transitions
*/
public void setStateTransitions(List stateTransitions) {
this.stateTransitions = stateTransitions;
@@ -58,15 +74,15 @@ public class SimpleFlowFactoryBean implements FactoryBean, InitializingBean {
/**
* Check mandatory properties (name).
- *
+ *
* @throws Exception
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.hasText(name, "The flow must have a name");
}
- @Override
+ @Override
public Object getObject() throws Exception {
SimpleFlow flow = new SimpleFlow(name);
@@ -95,7 +111,7 @@ public class SimpleFlowFactoryBean implements FactoryBean, InitializingBean {
* Convenience method to get a state that proxies the input but with a
* different name, appropriate to this flow. If the state is a StepState
* then the step name is also changed.
- *
+ *
* @param state
* @return
*/
@@ -111,22 +127,22 @@ public class SimpleFlowFactoryBean implements FactoryBean, InitializingBean {
return new DelegateState(stateName, state);
}
- @Override
+ @Override
public Class> getObjectType() {
return SimpleFlow.class;
}
- @Override
+ @Override
public boolean isSingleton() {
return true;
}
/**
* A State that proxies a delegate and changes its name but leaves its
- * behaviour unchanged.
- *
+ * behavior unchanged.
+ *
* @author Dave Syer
- *
+ *
*/
private static class DelegateState extends AbstractState implements FlowHolder {
private final State state;
@@ -136,7 +152,7 @@ public class SimpleFlowFactoryBean implements FactoryBean, InitializingBean {
this.state = state;
}
- @Override
+ @Override
public boolean isEndState() {
return state.isEndState();
}
@@ -146,11 +162,11 @@ public class SimpleFlowFactoryBean implements FactoryBean, InitializingBean {
return state.handle(executor);
}
- @Override
+ @Override
public Collection getFlows() {
return (state instanceof FlowHolder) ? ((FlowHolder)state).getFlows() : Collections.emptyList();
}
-
+
}
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepListenerParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepListenerParser.java
index 818d8e0eb..bc33146f6 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepListenerParser.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepListenerParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2009 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,13 +32,13 @@ import org.w3c.dom.Element;
/**
* Parser for a step listener element. Builds a {@link StepListenerFactoryBean}
* using attributes from the configuration.
- *
+ *
* @author Dan Garrette
* @since 2.0
* @see AbstractListenerParser
*/
public class StepListenerParser extends AbstractListenerParser {
-
+
private static final String LISTENERS_ELE = "listeners";
private static final String MERGE_ATTR = "merge";
@@ -53,17 +53,17 @@ public class StepListenerParser extends AbstractListenerParser {
this.listenerMetaData = listenerMetaData;
}
- @Override
+ @Override
protected Class extends AbstractListenerFactoryBean> getBeanClass() {
return StepListenerFactoryBean.class;
}
- @Override
+ @Override
protected ListenerMetaData[] getMetaDataValues() {
return listenerMetaData;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked", "rawtypes"})
public void handleListenersElement(Element stepElement, BeanDefinition beanDefinition,
ParserContext parserContext) {
MutablePropertyValues propertyValues = beanDefinition.getPropertyValues();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java
index dbc9e601f..9cecd4c43 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ import org.springframework.util.Assert;
* This {@link FactoryBean} is used by the batch namespace parser to create {@link Step} objects. Stores all of the
* properties that are configurable on the <step/> (and its inner <tasklet/>). Based on which properties are
* configured, the {@link #getObject()} method will delegate to the appropriate class for generating the {@link Step}.
- *
+ *
* @author Dan Garrette
* @author Josh Long
* @see SimpleStepFactoryBean
@@ -88,6 +88,7 @@ import org.springframework.util.Assert;
* @see TaskletStep
* @since 2.0
*/
+@SuppressWarnings("rawtypes")
class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
//
@@ -217,10 +218,10 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Create a {@link Step} from the configuration provided.
- *
+ *
* @see FactoryBean#getObject()
*/
- @Override
+ @Override
public final Object getObject() throws Exception {
if (hasChunkElement) {
Assert.isNull(tasklet, "Step [" + name
@@ -382,7 +383,6 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
@SuppressWarnings("unchecked")
private Step createSimpleStep() {
- @SuppressWarnings("rawtypes")
SimpleStepBuilder builder = new SimpleStepBuilder(new StepBuilder(name));
if (commitInterval != null) {
builder.chunk(commitInterval);
@@ -402,6 +402,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
return builder.build();
}
+ @SuppressWarnings("serial")
private void enhanceTaskletStepBuilder(AbstractTaskletStepBuilder> builder) {
enhanceCommonStep(builder);
@@ -474,7 +475,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Check if a field is present then a second is also. If the twoWayDependency flag is set then the opposite must
* also be true: if the second value is present, the first must also be.
- *
+ *
* @param dependentName the name of the first field
* @param dependentValue the value of the first field
* @param name the name of the other field (which should be absent if the first is present)
@@ -496,7 +497,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Is the object non-null (or if an Integer, non-zero)?
- *
+ *
* @param o an object
* @return true if the object has a value
*/
@@ -526,12 +527,12 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
return n != null && n > 0;
}
- @Override
+ @Override
public Class getObjectType() {
return TaskletStep.class;
}
- @Override
+ @Override
public boolean isSingleton() {
return true;
}
@@ -542,10 +543,10 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Set the bean name property, which will become the name of the {@link Step} when it is created.
- *
+ *
* @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String)
*/
- @Override
+ @Override
public void setBeanName(String name) {
if (this.name == null) {
this.name = name;
@@ -632,7 +633,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for the flag to indicate that the step should be replayed on a restart, even if successful the
* first time.
- *
+ *
* @param allowStartIfComplete the shouldAllowStartIfComplete to set
*/
public void setAllowStartIfComplete(boolean allowStartIfComplete) {
@@ -649,7 +650,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for {@link JobRepository}.
- *
+ *
* @param jobRepository
*/
public void setJobRepository(JobRepository jobRepository) {
@@ -658,7 +659,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* The number of times that the step should be allowed to start
- *
+ *
* @param startLimit
*/
public void setStartLimit(int startLimit) {
@@ -667,7 +668,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* A preconfigured {@link Tasklet} to use.
- *
+ *
* @param tasklet
*/
public void setTasklet(Tasklet tasklet) {
@@ -695,7 +696,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* The listeners to inject into the {@link Step}. Any instance of {@link StepListener} can be used, and will then
* receive callbacks at the appropriate stage in the step.
- *
+ *
* @param listeners an array of listeners
*/
public void setListeners(StepListener[] listeners) {
@@ -734,7 +735,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Exception classes that may not cause a rollback if encountered in the right place.
- *
+ *
* @param noRollbackExceptionClasses the noRollbackExceptionClasses to set
*/
public void setNoRollbackExceptionClasses(Collection> noRollbackExceptionClasses) {
@@ -768,7 +769,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* A backoff policy to be applied to retry process.
- *
+ *
* @param backOffPolicy the {@link BackOffPolicy} to set
*/
public void setBackOffPolicy(BackOffPolicy backOffPolicy) {
@@ -778,7 +779,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* A retry policy to apply when exceptions occur. If this is specified then the retry limit and retryable exceptions
* will be ignored.
- *
+ *
* @param retryPolicy the {@link RetryPolicy} to set
*/
public void setRetryPolicy(RetryPolicy retryPolicy) {
@@ -795,7 +796,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* A key generator that can be used to compare items with previously recorded items in a retry. Only used if the
* reader is a transactional queue.
- *
+ *
* @param keyGenerator the {@link KeyGenerator} to set
*/
public void setKeyGenerator(KeyGenerator keyGenerator) {
@@ -814,7 +815,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
* The default value should be high enough and more for most purposes. To breach the limit in a single-threaded step
* typically you have to have this many failures in a single transaction. Defaults to the value in the
* {@link MapRetryContextCache}.
- *
+ *
* @param cacheCapacity the cache capacity to set (greater than 0 else ignored)
*/
public void setCacheCapacity(int cacheCapacity) {
@@ -825,7 +826,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
* Public setter for the {@link CompletionPolicy} applying to the chunk level. A transaction will be committed when
* this policy decides to complete. Defaults to a {@link SimpleCompletionPolicy} with chunk size equal to the
* commitInterval property.
- *
+ *
* @param chunkCompletionPolicy the chunkCompletionPolicy to set
*/
public void setChunkCompletionPolicy(CompletionPolicy chunkCompletionPolicy) {
@@ -834,7 +835,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Set the commit interval. Either set this or the chunkCompletionPolicy but not both.
- *
+ *
* @param commitInterval 1 by default
*/
public void setCommitInterval(int commitInterval) {
@@ -844,7 +845,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Flag to signal that the reader is transactional (usually a JMS consumer) so that items are re-presented after a
* rollback. The default is false and readers are assumed to be forward-only.
- *
+ *
* @param isReaderTransactionalQueue the value of the flag
*/
public void setIsReaderTransactionalQueue(boolean isReaderTransactionalQueue) {
@@ -854,7 +855,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Flag to signal that the processor is transactional, in which case it should be called for every item in every
* transaction. If false then we can cache the processor results between transactions in the case of a rollback.
- *
+ *
* @param processorTransactional the value to set
*/
public void setProcessorTransactional(Boolean processorTransactional) {
@@ -864,7 +865,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for the retry limit. Each item can be retried up to this limit. Note this limit includes the
* initial attempt to process the item, therefore retryLimit == 1 by default.
- *
+ *
* @param retryLimit the retry limit to set, must be greater or equal to 1.
*/
public void setRetryLimit(int retryLimit) {
@@ -875,7 +876,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
* Public setter for a limit that determines skip policy. If this value is positive then an exception in chunk
* processing will cause the item to be skipped and no exception propagated until the limit is reached. If it is
* zero then all exceptions will be propagated from the chunk and cause the step to abort.
- *
+ *
* @param skipLimit the value to set. Default is 0 (never skip).
*/
public void setSkipLimit(int skipLimit) {
@@ -884,7 +885,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for a skip policy. If this value is set then the skip limit and skippable exceptions are ignored.
- *
+ *
* @param skipPolicy the {@link SkipPolicy} to set
*/
public void setSkipPolicy(SkipPolicy skipPolicy) {
@@ -894,7 +895,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for the {@link TaskExecutor}. If this is set, then it will be used to execute the chunk processing
* inside the {@link Step}.
- *
+ *
* @param taskExecutor the taskExecutor to set
*/
public void setTaskExecutor(TaskExecutor taskExecutor) {
@@ -904,7 +905,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for the throttle limit. This limits the number of tasks queued for concurrent processing to prevent
* thread pools from being overwhelmed. Defaults to {@link TaskExecutorRepeatTemplate#DEFAULT_THROTTLE_LIMIT}.
- *
+ *
* @param throttleLimit the throttle limit to set.
*/
public void setThrottleLimit(Integer throttleLimit) {
@@ -938,7 +939,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for the {@link RetryListener}s.
- *
+ *
* @param retryListeners the {@link RetryListener}s to set
*/
public void setRetryListeners(RetryListener... retryListeners) {
@@ -948,7 +949,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for exception classes that when raised won't crash the job but will result in transaction rollback
* and the item which handling caused the exception will be skipped.
- *
+ *
* @param exceptionClasses
*/
public void setSkippableExceptionClasses(Map, Boolean> exceptionClasses) {
@@ -957,7 +958,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* Public setter for exception classes that will retry the item when raised.
- *
+ *
* @param retryableExceptionClasses the retryableExceptionClasses to set
*/
public void setRetryableExceptionClasses(Map, Boolean> retryableExceptionClasses) {
@@ -967,7 +968,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware {
/**
* The streams to inject into the {@link Step}. Any instance of {@link ItemStream} can be used, and will then
* receive callbacks at the appropriate stage in the step.
- *
+ *
* @param streams an array of listeners
*/
public void setStreams(ItemStream[] streams) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java
index 444c9729e..7c1d8c000 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,23 +38,23 @@ import org.springframework.util.StringUtils;
* convention for property keys. Key names ending with "(<type>)" where
* type is one of string, date, long are converted to the corresponding type.
* The default type is string. E.g.
- *
+ *
*
* schedule.date(date)=2007/12/11
* department.id(long)=2345
*
- *
+ *
* The literal values are converted to the correct type using the default Spring
* strategies, augmented if necessary by the custom editors provided.
- *
+ *
*
- *
+ *
* If you need to be able to parse and format local-specific dates and numbers,
* you can inject formatters ({@link #setDateFormat(DateFormat)} and
* {@link #setNumberFormat(NumberFormat)}).
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class DefaultJobParametersConverter implements JobParametersConverter {
@@ -77,13 +77,13 @@ public class DefaultJobParametersConverter implements JobParametersConverter {
/**
* Check for suffix on keys and use those to decide how to convert the
* value.
- *
+ *
* @throws IllegalArgumentException if a number or date is passed in that
* cannot be parsed, or cast to the correct type.
- *
+ *
* @see org.springframework.batch.core.converter.JobParametersConverter#getJobParameters(java.util.Properties)
*/
- @Override
+ @Override
public JobParameters getJobParameters(Properties props) {
if (props == null || props.isEmpty()) {
@@ -104,7 +104,7 @@ public class DefaultJobParametersConverter implements JobParametersConverter {
catch (ParseException ex) {
String suffix = (dateFormat instanceof SimpleDateFormat) ? ", use "
+ ((SimpleDateFormat) dateFormat).toPattern() : "";
- throw new IllegalArgumentException("Date format is invalid: [" + value + "]" + suffix);
+ throw new IllegalArgumentException("Date format is invalid: [" + value + "]" + suffix);
}
propertiesBuilder.addDate(StringUtils.replace(key, DATE_TYPE, ""), date);
}
@@ -144,17 +144,17 @@ public class DefaultJobParametersConverter implements JobParametersConverter {
catch (ParseException ex) {
String suffix = (numberFormat instanceof DecimalFormat) ? ", use "
+ ((DecimalFormat) numberFormat).toPattern() : "";
- throw new IllegalArgumentException("Number format is invalid: [" + value + "], use " + suffix);
+ throw new IllegalArgumentException("Number format is invalid: [" + value + "], use " + suffix);
}
}
/**
* Use the same suffixes to create properties (omitting the string suffix
* because it is the default).
- *
+ *
* @see org.springframework.batch.core.converter.JobParametersConverter#getProperties(org.springframework.batch.core.JobParameters)
*/
- @Override
+ @Override
public Properties getProperties(JobParameters params) {
if (params == null || params.isEmpty()) {
@@ -199,7 +199,7 @@ public class DefaultJobParametersConverter implements JobParametersConverter {
/**
* Public setter for injecting a date format.
- *
+ *
* @param dateFormat a {@link DateFormat}, defaults to "yyyy/MM/dd"
*/
public void setDateFormat(DateFormat dateFormat) {
@@ -209,7 +209,7 @@ public class DefaultJobParametersConverter implements JobParametersConverter {
/**
* Public setter for the {@link NumberFormat}. Used to parse longs and
* doubles, so must not contain decimal place (e.g. use "#" or "#,###").
- *
+ *
* @param numberFormat the {@link NumberFormat} to set
*/
public void setNumberFormat(NumberFormat numberFormat) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java
index 2f097794c..a6219d8d1 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,13 +27,14 @@ import org.springframework.beans.factory.FactoryBean;
* A {@link FactoryBean} that automates the creation of a
* {@link SimpleJobExplorer}. Declares abstract methods for providing DAO
* object implementations.
- *
+ *
* @see JobExplorerFactoryBean
* @see MapJobExplorerFactoryBean
- *
+ *
* @author Dave Syer
* @since 2.0
*/
+@SuppressWarnings("rawtypes")
public abstract class AbstractJobExplorerFactoryBean implements FactoryBean {
/**
@@ -45,23 +46,23 @@ public abstract class AbstractJobExplorerFactoryBean implements FactoryBean {
* @return fully configured {@link JobExecutionDao} implementation.
*/
protected abstract JobExecutionDao createJobExecutionDao() throws Exception;
-
+
protected abstract StepExecutionDao createStepExecutionDao() throws Exception;
protected abstract ExecutionContextDao createExecutionContextDao() throws Exception;
/**
* The type of object to be returned from {@link #getObject()}.
- *
+ *
* @return JobExplorer.class
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
*/
- @Override
+ @Override
public Class getObjectType() {
return JobExplorer.class;
}
- @Override
+ @Override
public boolean isSingleton() {
return true;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java
index 8f5a9c097..f60b57920 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ import org.springframework.util.Assert;
* @since 2.0
*/
public class JobExplorerFactoryBean extends AbstractJobExplorerFactoryBean
- implements InitializingBean {
+implements InitializingBean {
private DataSource dataSource;
@@ -107,7 +107,7 @@ public class JobExplorerFactoryBean extends AbstractJobExplorerFactoryBean
this.lobHandler = lobHandler;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(dataSource, "DataSource must not be null.");
@@ -169,7 +169,7 @@ public class JobExplorerFactoryBean extends AbstractJobExplorerFactoryBean
return dao;
}
- @Override
+ @Override
public Object getObject() throws Exception {
return getTarget();
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java
index dc967fa2f..b8df7e977 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
/**
* A {@link FactoryBean} that automates the creation of a
* {@link SimpleJobExplorer} using in-memory DAO implementations.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -54,7 +54,7 @@ public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean im
/**
* The repository factory that can be used to create daos for the explorer.
- *
+ *
* @param repositoryFactory a {@link MapJobExplorerFactoryBean}
*/
public void setRepositoryFactory(MapJobRepositoryFactoryBean repositoryFactory) {
@@ -65,7 +65,7 @@ public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean im
* @throws Exception
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.state(repositoryFactory != null, "A MapJobRepositoryFactoryBean must be provided");
repositoryFactory.afterPropertiesSet();
@@ -91,7 +91,7 @@ public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean im
return repositoryFactory.getExecutionContextDao();
}
- @Override
+ @Override
public Object getObject() throws Exception {
return new SimpleJobExplorer(createJobInstanceDao(), createJobExecutionDao(), createStepExecutionDao(),
createExecutionContextDao());
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java
index 145c76cd3..6839d6953 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/SimpleJobExplorer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,10 +30,10 @@ import org.springframework.batch.core.repository.dao.StepExecutionDao;
/**
* Implementation of {@link JobExplorer} using the injected DAOs.
- *
+ *
* @author Dave Syer
* @author Lucas Ward
- *
+ *
* @see JobExplorer
* @see JobInstanceDao
* @see JobExecutionDao
@@ -68,12 +68,12 @@ public class SimpleJobExplorer implements JobExplorer {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.explore.JobExplorer#findJobExecutions(
* org.springframework.batch.core.JobInstance)
*/
- @Override
+ @Override
public List getJobExecutions(JobInstance jobInstance) {
List executions = jobExecutionDao.findJobExecutions(jobInstance);
for (JobExecution jobExecution : executions) {
@@ -87,12 +87,12 @@ public class SimpleJobExplorer implements JobExplorer {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.explore.JobExplorer#findRunningJobExecutions
* (java.lang.String)
*/
- @Override
+ @Override
public Set findRunningJobExecutions(String jobName) {
Set executions = jobExecutionDao.findRunningJobExecutions(jobName);
for (JobExecution jobExecution : executions) {
@@ -106,12 +106,12 @@ public class SimpleJobExplorer implements JobExplorer {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.explore.JobExplorer#getJobExecution(java
* .lang.Long)
*/
- @Override
+ @Override
public JobExecution getJobExecution(Long executionId) {
if (executionId == null) {
return null;
@@ -129,12 +129,12 @@ public class SimpleJobExplorer implements JobExplorer {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.explore.JobExplorer#getStepExecution(java
* .lang.Long)
*/
- @Override
+ @Override
public StepExecution getStepExecution(Long jobExecutionId, Long executionId) {
JobExecution jobExecution = jobExecutionDao.getJobExecution(jobExecutionId);
if (jobExecution == null) {
@@ -147,34 +147,34 @@ public class SimpleJobExplorer implements JobExplorer {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.explore.JobExplorer#getJobInstance(java
* .lang.Long)
*/
- @Override
+ @Override
public JobInstance getJobInstance(Long instanceId) {
return jobInstanceDao.getJobInstance(instanceId);
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.explore.JobExplorer#getLastJobInstances
* (java.lang.String, int)
*/
- @Override
+ @Override
public List getJobInstances(String jobName, int start, int count) {
return jobInstanceDao.getJobInstances(jobName, start, count);
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.explore.JobExplorer#getJobNames()
*/
- @Override
+ @Override
public List getJobNames() {
return jobInstanceDao.getJobNames();
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java
index 3a128b801..b8941b3c5 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/AbstractJob.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2009 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,12 +50,12 @@ import org.springframework.util.ClassUtils;
* such as a {@link JobRepository}, {@link JobExecutionListener}s, and various
* configuration parameters are set here. Therefore, common error handling and
* listener calling activities are abstracted away from implementations.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
*/
public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
- InitializingBean {
+InitializingBean {
protected static final Log logger = LogFactory.getLog(AbstractJob.class);
@@ -83,7 +83,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Convenience constructor to immediately add name (which is mandatory but
* not final).
- *
+ *
* @param name
*/
public AbstractJob(String name) {
@@ -94,7 +94,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* A validator for job parameters. Defaults to a vanilla
* {@link DefaultJobParametersValidator}.
- *
+ *
* @param jobParametersValidator
* a validator instance
*/
@@ -105,10 +105,10 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Assert mandatory properties: {@link JobRepository}.
- *
+ *
* @see InitializingBean#afterPropertiesSet()
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(jobRepository, "JobRepository must be set");
}
@@ -119,10 +119,10 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
* if it is present. Care is needed with bean definition inheritance - if a
* parent bean has a name, then its children need an explicit name as well,
* otherwise they will not be unique.
- *
+ *
* @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String)
*/
- @Override
+ @Override
public void setBeanName(String name) {
if (this.name == null) {
this.name = name;
@@ -132,7 +132,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Set the name property. Always overrides the default value if this object
* is a Spring bean.
- *
+ *
* @see #setBeanName(java.lang.String)
*/
public void setName(String name) {
@@ -141,10 +141,10 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.domain.IJob#getName()
*/
- @Override
+ @Override
public String getName() {
return name;
}
@@ -152,22 +152,22 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Retrieve the step with the given name. If there is no Step with the given
* name, then return null.
- *
+ *
* @param stepName
* @return the Step
*/
- @Override
+ @Override
public abstract Step getStep(String stepName);
/**
* Retrieve the step names.
- *
+ *
* @return the step names
*/
- @Override
+ @Override
public abstract Collection getStepNames();
- @Override
+ @Override
public JobParametersValidator getJobParametersValidator() {
return jobParametersValidator;
}
@@ -175,7 +175,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Boolean flag to prevent categorically a job from restarting, even if it
* has failed previously.
- *
+ *
* @param restartable
* the value of the flag to set (default true)
*/
@@ -186,14 +186,14 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* @see Job#isRestartable()
*/
- @Override
+ @Override
public boolean isRestartable() {
return restartable;
}
/**
* Public setter for the {@link JobParametersIncrementer}.
- *
+ *
* @param jobParametersIncrementer
* the {@link JobParametersIncrementer} to set
*/
@@ -204,10 +204,10 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.Job#getJobParametersIncrementer()
*/
- @Override
+ @Override
public JobParametersIncrementer getJobParametersIncrementer() {
return this.jobParametersIncrementer;
}
@@ -215,7 +215,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Public setter for injecting {@link JobExecutionListener}s. They will all
* be given the listener callbacks at the appropriate point in the job.
- *
+ *
* @param listeners
* the listeners to set.
*/
@@ -228,7 +228,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Register a single listener for the {@link JobExecutionListener}
* callbacks.
- *
+ *
* @param listener
* a {@link JobExecutionListener}
*/
@@ -240,7 +240,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
* Public setter for the {@link JobRepository} that is needed to manage the
* state of the batch meta domain (jobs, steps, executions) during the life
* of a job.
- *
+ *
* @param jobRepository
*/
public void setJobRepository(JobRepository jobRepository) {
@@ -250,7 +250,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Convenience method for subclasses to access the job repository.
- *
+ *
* @return the jobRepository
*/
protected JobRepository getJobRepository() {
@@ -262,10 +262,10 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
* logic and ignore listeners and repository calls. Implementations usually
* are concerned with the ordering of steps, and delegate actual step
* processing to {@link #handleStep(Step, JobExecution)}.
- *
+ *
* @param execution
* the current {@link JobExecution}
- *
+ *
* @throws JobExecutionException
* to signal a fatal batch framework error (not a business or
* validation exception)
@@ -276,12 +276,12 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Run the specified job, handling all listener and repository calls, and
* delegating the actual processing to {@link #doExecute(JobExecution)}.
- *
+ *
* @see Job#execute(JobExecution)
* @throws StartLimitExceededException
* if start limit of one of the steps was exceeded
*/
- @Override
+ @Override
public final void execute(JobExecution execution) {
logger.debug("Job execution starting: " + execution);
@@ -334,8 +334,8 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
&& execution.getStepExecutions().isEmpty()) {
ExitStatus exitStatus = execution.getExitStatus();
execution
- .setExitStatus(exitStatus.and(ExitStatus.NOOP
- .addExitDescription("All steps already completed or no steps configured for this job.")));
+ .setExitStatus(exitStatus.and(ExitStatus.NOOP
+ .addExitDescription("All steps already completed or no steps configured for this job.")));
}
execution.setEndTime(new Date());
@@ -358,13 +358,13 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
* method do not need access to the {@link JobRepository}, nor do they need
* to worry about populating the execution context on a restart, nor
* detecting the interrupted state (in job or step execution).
- *
+ *
* @param step
* the {@link Step} to execute
* @param execution
* the current {@link JobExecution}
* @return the {@link StepExecution} corresponding to this step
- *
+ *
* @throws JobInterruptedException
* if the {@link JobExecution} has been interrupted, and in
* particular if {@link BatchStatus#ABANDONED} or
@@ -384,7 +384,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
/**
* Default mapping from throwable to {@link ExitStatus}.
- *
+ *
* @param ex
* the cause of the failure
* @return an {@link ExitStatus}
@@ -411,7 +411,7 @@ public abstract class AbstractJob implements Job, StepLocator, BeanNameAware,
jobRepository.update(jobExecution);
}
- @Override
+ @Override
public String toString() {
return ClassUtils.getShortName(getClass()) + ": [name=" + name + "]";
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/CompositeJobParametersValidator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/CompositeJobParametersValidator.java
index 601193e69..c8e449aec 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/CompositeJobParametersValidator.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/CompositeJobParametersValidator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,29 +25,29 @@ import org.springframework.util.Assert;
/**
* Composite {@link JobParametersValidator} that passes the job parameters through a sequence of
- * injected JobParametersValidators
- *
+ * injected JobParametersValidators
+ *
* @author Morten Andersen-Gott
*
*/
public class CompositeJobParametersValidator implements JobParametersValidator, InitializingBean {
private List validators;
-
+
/**
* Validates the JobParameters according to the injected JobParameterValidators
* Validation stops and exception is thrown on first validation error
- *
+ *
* @param parameters some {@link JobParameters}
* @throws JobParametersInvalidException if the parameters are invalid
*/
- @Override
+ @Override
public void validate(JobParameters parameters) throws JobParametersInvalidException {
for (JobParametersValidator validator : validators) {
validator.validate(parameters);
}
}
-
+
/**
* Public setter for the validators
* @param validators
@@ -56,12 +56,12 @@ public class CompositeJobParametersValidator implements JobParametersValidator,
this.validators = validators;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(validators, "The 'validators' may not be null");
Assert.notEmpty(validators, "The 'validators' may not be empty");
}
-
-
+
+
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/DefaultJobParametersValidator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/DefaultJobParametersValidator.java
index c66cb43ff..2e81f4731 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/DefaultJobParametersValidator.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/DefaultJobParametersValidator.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.batch.core.job;
import java.util.Arrays;
@@ -13,9 +28,9 @@ import org.springframework.util.Assert;
/**
* Default implementation of {@link JobParametersValidator}.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class DefaultJobParametersValidator implements JobParametersValidator, InitializingBean {
@@ -33,10 +48,10 @@ public class DefaultJobParametersValidator implements JobParametersValidator, In
/**
* Create a new validator with the required and optional job parameter keys
* provided.
- *
+ *
* @see DefaultJobParametersValidator#setOptionalKeys(String[])
* @see DefaultJobParametersValidator#setRequiredKeys(String[])
- *
+ *
* @param requiredKeys the required keys
* @param optionalKeys the optional keys
*/
@@ -50,7 +65,7 @@ public class DefaultJobParametersValidator implements JobParametersValidator, In
* Check that there are no overlaps between required and optional keys.
* @throws IllegalStateException if there is an overlap
*/
- @Override
+ @Override
public void afterPropertiesSet() throws IllegalStateException {
for (String key : requiredKeys) {
Assert.state(!optionalKeys.contains(key), "Optional keys canot be required: " + key);
@@ -62,12 +77,12 @@ public class DefaultJobParametersValidator implements JobParametersValidator, In
* are explicitly specified then all keys must be in that list, or in the
* required list. Otherwise all keys that are specified as required must be
* present.
- *
+ *
* @see JobParametersValidator#validate(JobParameters)
- *
+ *
* @throws JobParametersInvalidException if the parameters are not valid
*/
- @Override
+ @Override
public void validate(JobParameters parameters) throws JobParametersInvalidException {
if (parameters == null) {
@@ -109,9 +124,9 @@ public class DefaultJobParametersValidator implements JobParametersValidator, In
* The keys that are required in the parameters. The default is empty,
* meaning that all parameters are optional, unless optional keys are
* explicitly specified.
- *
+ *
* @param requiredKeys the required key values
- *
+ *
* @see #setOptionalKeys(String[])
*/
public final void setRequiredKeys(String[] requiredKeys) {
@@ -123,9 +138,9 @@ public class DefaultJobParametersValidator implements JobParametersValidator, In
* optional, then to be valid all other keys must be explicitly required.
* The default is empty, meaning that all parameters that are not required
* are optional.
- *
+ *
* @param optionalKeys the optional key values
- *
+ *
* @see #setRequiredKeys(String[])
*/
public final void setOptionalKeys(String[] optionalKeys) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleJob.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleJob.java
index 03f37f8c3..3ea13e82a 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleJob.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleJob.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ import org.springframework.batch.core.repository.JobRestartException;
* {@link JobExecution}. Sequentially executes a job by iterating through its
* list of steps. Any {@link Step} that fails will fail the job. The job is
* considered complete when all steps have been executed.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
*/
@@ -59,7 +59,7 @@ public class SimpleJob extends AbstractJob {
/**
* Public setter for the steps in this job. Overrides any calls to
* {@link #addStep(Step)}.
- *
+ *
* @param steps the steps to execute
*/
public void setSteps(List steps) {
@@ -69,10 +69,10 @@ public class SimpleJob extends AbstractJob {
/**
* Convenience method for clients to inspect the steps for this job.
- *
+ *
* @return the step names for this job
*/
- @Override
+ @Override
public Collection getStepNames() {
List names = new ArrayList();
for (Step step : steps) {
@@ -83,7 +83,7 @@ public class SimpleJob extends AbstractJob {
/**
* Convenience method for adding a single step to the job.
- *
+ *
* @param step a {@link Step} to add
*/
public void addStep(Step step) {
@@ -92,11 +92,11 @@ public class SimpleJob extends AbstractJob {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.job.AbstractJob#getStep(java.lang.String)
*/
- @Override
+ @Override
public Step getStep(String stepName) {
for (Step step : this.steps) {
if (step.getName().equals(stepName)) {
@@ -110,14 +110,14 @@ public class SimpleJob extends AbstractJob {
* Handler of steps sequentially as provided, checking each one for success
* before moving to the next. Returns the last {@link StepExecution}
* successfully processed if it exists, and null if none were processed.
- *
+ *
* @param execution the current {@link JobExecution}
- *
+ *
* @see AbstractJob#handleStep(Step, JobExecution)
*/
- @Override
+ @Override
protected void doExecute(JobExecution execution) throws JobInterruptedException, JobRestartException,
- StartLimitExceededException {
+ StartLimitExceededException {
StepExecution stepExecution = null;
for (Step step : steps) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleStepHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleStepHandler.java
index 71dba7d51..21a494085 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleStepHandler.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/SimpleStepHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2009 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,9 +34,9 @@ import org.springframework.util.Assert;
/**
* Implementation of {@link StepHandler} that manages repository and restart
* concerns.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class SimpleStepHandler implements StepHandler, InitializingBean {
@@ -71,10 +71,10 @@ public class SimpleStepHandler implements StepHandler, InitializingBean {
/**
* Check mandatory properties (jobRepository).
- *
+ *
* @see InitializingBean#afterPropertiesSet()
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.state(jobRepository != null, "A JobRepository must be provided");
}
@@ -89,16 +89,16 @@ public class SimpleStepHandler implements StepHandler, InitializingBean {
/**
* A context containing values to be added to the step execution before it
* is handled.
- *
+ *
* @param executionContext the execution context to set
*/
public void setExecutionContext(ExecutionContext executionContext) {
this.executionContext = executionContext;
}
- @Override
+ @Override
public StepExecution handleStep(Step step, JobExecution execution) throws JobInterruptedException,
- JobRestartException, StartLimitExceededException {
+ JobRestartException, StartLimitExceededException {
if (execution.isStopping()) {
throw new JobInterruptedException("JobExecution interrupted.");
}
@@ -178,7 +178,7 @@ public class SimpleStepHandler implements StepHandler, InitializingBean {
* @param lastStepExecution the last step execution
* @param jobInstance
* @param step
- *
+ *
* @throws StartLimitExceededException if the start limit has been exceeded
* for this step
* @throws JobRestartException if the job is in an inconsistent state from
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/JobFlowBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/JobFlowBuilder.java
index 3a6730056..091ebece1 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/JobFlowBuilder.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/JobFlowBuilder.java
@@ -21,7 +21,7 @@ import org.springframework.batch.core.job.flow.JobExecutionDecider;
/**
* @author Dave Syer
- *
+ *
*/
public class JobFlowBuilder extends FlowBuilder {
@@ -53,10 +53,10 @@ public class JobFlowBuilder extends FlowBuilder {
/**
* Build a flow and inject it into the parent builder. The parent builder is then returned so it can be enhanced
* before building an actual job. Normally called explicitly via {@link #end()}.
- *
+ *
* @see org.springframework.batch.core.job.builder.FlowBuilder#build()
*/
- @Override
+ @Override
public FlowJobBuilder build() {
Flow flow = flow();
parent.flow(flow);
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowExecution.java
index 2b28f9de9..c20c35612 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowExecution.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowExecution.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,13 +51,13 @@ public class FlowExecution implements Comparable {
/**
* Create an ordering on {@link FlowExecution} instances by comparing their
* statuses.
- *
+ *
* @see Comparable#compareTo(Object)
- *
+ *
* @param other
* @return negative, zero or positive as per the contract
*/
- @Override
+ @Override
public int compareTo(FlowExecution other) {
return this.status.compareTo(other.getStatus());
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowExecutionStatus.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowExecutionStatus.java
index 776f75905..24416fe93 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowExecutionStatus.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/FlowExecutionStatus.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package org.springframework.batch.core.job.flow;
/**
* Represents the status of {@link FlowExecution}.
- *
+ *
* @author Dan Garrette
* @author Dave Syer
* @since 2.0
@@ -101,13 +101,13 @@ public class FlowExecutionStatus implements Comparable {
/**
* Create an ordering on {@link FlowExecutionStatus} instances by comparing
* their statuses.
- *
+ *
* @see Comparable#compareTo(Object)
- *
+ *
* @param other
* @return negative, zero or positive as per the contract
*/
- @Override
+ @Override
public int compareTo(FlowExecutionStatus other) {
Status one = Status.match(this.name);
Status two = Status.match(other.name);
@@ -120,7 +120,7 @@ public class FlowExecutionStatus implements Comparable {
/**
* Check the equality of the statuses.
- *
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/JobFlowExecutor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/JobFlowExecutor.java
index af9d10c02..35eb94382 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/JobFlowExecutor.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/JobFlowExecutor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2009 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,9 +30,9 @@ import org.springframework.batch.core.repository.JobRestartException;
/**
* Implementation of {@link FlowExecutor} for use in components that need to
* execute a flow related to a {@link JobExecution}.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class JobFlowExecutor implements FlowExecutor {
@@ -56,13 +56,13 @@ public class JobFlowExecutor implements FlowExecutor {
stepExecutionHolder.set(null);
}
- @Override
+ @Override
public String executeStep(Step step) throws JobInterruptedException, JobRestartException,
- StartLimitExceededException {
+ StartLimitExceededException {
StepExecution stepExecution = stepHandler.handleStep(step, execution);
stepExecutionHolder.set(stepExecution);
if (stepExecution == null) {
- return ExitStatus.COMPLETED.getExitCode();
+ return ExitStatus.COMPLETED.getExitCode();
}
if (stepExecution.isTerminateOnly()) {
throw new JobInterruptedException("Step requested termination: "+stepExecution, stepExecution.getStatus());
@@ -70,7 +70,7 @@ public class JobFlowExecutor implements FlowExecutor {
return stepExecution.getExitStatus().getExitCode();
}
- @Override
+ @Override
public void abandonStepExecution() {
StepExecution lastStepExecution = stepExecutionHolder.get();
if (lastStepExecution != null && lastStepExecution.getStatus().isGreaterThan(BatchStatus.STOPPING)) {
@@ -79,29 +79,29 @@ public class JobFlowExecutor implements FlowExecutor {
}
}
- @Override
+ @Override
public void updateJobExecutionStatus(FlowExecutionStatus status) {
execution.setStatus(findBatchStatus(status));
exitStatus = exitStatus.and(new ExitStatus(status.getName()));
execution.setExitStatus(exitStatus);
}
- @Override
+ @Override
public JobExecution getJobExecution() {
return execution;
}
- @Override
+ @Override
public StepExecution getStepExecution() {
return stepExecutionHolder.get();
}
- @Override
+ @Override
public void close(FlowExecution result) {
stepExecutionHolder.set(null);
}
- @Override
+ @Override
public boolean isRestart() {
if (getStepExecution() != null && getStepExecution().getStatus() == BatchStatus.ABANDONED) {
/*
@@ -114,7 +114,7 @@ public class JobFlowExecutor implements FlowExecutor {
return execution.getStepExecutions().isEmpty();
}
- @Override
+ @Override
public void addExitStatus(String code) {
exitStatus = exitStatus.and(new ExitStatus(code));
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/SimpleFlow.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/SimpleFlow.java
index 489ec78c6..08d2f460c 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/SimpleFlow.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/SimpleFlow.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ import org.springframework.beans.factory.InitializingBean;
* particular order). The start state name can be specified explicitly (and must
* exist in the set of transitions), or computed from the existing transitions,
* if unambiguous.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -63,7 +63,7 @@ public class SimpleFlow implements Flow, InitializingBean {
/**
* Create a flow with the given name.
- *
+ *
* @param name the name of the flow
*/
public SimpleFlow(String name) {
@@ -72,17 +72,17 @@ public class SimpleFlow implements Flow, InitializingBean {
/**
* Get the name for this flow.
- *
+ *
* @see Flow#getName()
*/
- @Override
+ @Override
public String getName() {
return name;
}
/**
* Public setter for the stateTransitions.
- *
+ *
* @param stateTransitions the stateTransitions to set
*/
public void setStateTransitions(List stateTransitions) {
@@ -93,25 +93,25 @@ public class SimpleFlow implements Flow, InitializingBean {
/**
* {@inheritDoc}
*/
- @Override
+ @Override
public State getState(String stateName) {
return stateMap.get(stateName);
}
-
+
/**
* {@inheritDoc}
*/
- @Override
+ @Override
public Collection getStates() {
return new HashSet(stateMap.values());
}
/**
* Locate start state and pre-populate data structures needed for execution.
- *
+ *
* @see InitializingBean#afterPropertiesSet()
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
initializeTransitions();
}
@@ -119,7 +119,7 @@ public class SimpleFlow implements Flow, InitializingBean {
/**
* @see Flow#start(FlowExecutor)
*/
- @Override
+ @Override
public FlowExecution start(FlowExecutor executor) throws FlowExecutionException {
if (startState == null) {
initializeTransitions();
@@ -132,7 +132,7 @@ public class SimpleFlow implements Flow, InitializingBean {
/**
* @see Flow#resume(String, FlowExecutor)
*/
- @Override
+ @Override
public FlowExecution resume(String stateName, FlowExecutor executor) throws FlowExecutionException {
FlowExecutionStatus status = FlowExecutionStatus.UNKNOWN;
@@ -158,7 +158,7 @@ public class SimpleFlow implements Flow, InitializingBean {
throw new FlowExecutionException(String.format("Ended flow=%s at state=%s with exception", name,
stateName), e);
}
-
+
logger.debug("Completed state="+stateName+" with status="+status);
state = nextState(stateName, status);
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/StateTransition.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/StateTransition.java
index 5cbc2e5f7..4afafcead 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/StateTransition.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/StateTransition.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import org.springframework.util.StringUtils;
* another. The originating State name and the next {@link State} to execute are
* linked by a pattern for the {@link ExitStatus#getExitCode() exit code} of an
* execution of the originating State.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -42,7 +42,7 @@ public final class StateTransition implements Comparable {
* Create a new end state {@link StateTransition} specification. This
* transition explicitly goes unconditionally to an end state (i.e. no more
* executions).
- *
+ *
* @param state the {@link State} used to generate the outcome for this
* transition
*/
@@ -54,7 +54,7 @@ public final class StateTransition implements Comparable {
* Create a new end state {@link StateTransition} specification. This
* transition explicitly goes to an end state (i.e. no more processing) if
* the outcome matches the pattern.
- *
+ *
* @param state the {@link State} used to generate the outcome for this
* transition
* @param pattern the pattern to match in the exit status of the
@@ -67,11 +67,11 @@ public final class StateTransition implements Comparable {
/**
* Convenience method to switch the origin and destination of a transition,
* creating a new instance.
- *
+ *
* @param stateTransition an existing state transition
* @param state the new state for the origin
* @param next the new name for the destination
- *
+ *
* @return a {@link StateTransition}
*/
public static StateTransition switchOriginAndDestination(StateTransition stateTransition, State state, String next) {
@@ -81,7 +81,7 @@ public final class StateTransition implements Comparable {
/**
* Create a new state {@link StateTransition} specification with a wildcard
* pattern that matches all outcomes.
- *
+ *
* @param state the {@link State} used to generate the outcome for this
* transition
* @param next the name of the next {@link State} to execute
@@ -93,7 +93,7 @@ public final class StateTransition implements Comparable {
/**
* Create a new {@link StateTransition} specification from one {@link State}
* to another (by name).
- *
+ *
* @param state the {@link State} used to generate the outcome for this
* transition
* @param pattern the pattern to match in the exit status of the
@@ -141,7 +141,7 @@ public final class StateTransition implements Comparable {
/**
* Check if the provided status matches the pattern, signalling that the
* next State should be executed.
- *
+ *
* @param status the status to compare
* @return true if the pattern matches this status
*/
@@ -151,7 +151,7 @@ public final class StateTransition implements Comparable {
/**
* Check for a special next State signalling the end of a job.
- *
+ *
* @return true if this transition goes nowhere (there is no next)
*/
public boolean isEnd() {
@@ -165,7 +165,7 @@ public final class StateTransition implements Comparable {
* fo? > foo.
* @see Comparable#compareTo(Object)
*/
- @Override
+ @Override
public int compareTo(StateTransition other) {
String value = other.pattern;
if (pattern.equals(value)) {
@@ -192,7 +192,7 @@ public final class StateTransition implements Comparable {
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#toString()
*/
@Override
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/AbstractState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/AbstractState.java
index 560d39128..ee531dfa7 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/AbstractState.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/AbstractState.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,21 +25,21 @@ import org.springframework.batch.core.job.flow.State;
* @since 2.0
*/
public abstract class AbstractState implements State {
-
+
private final String name;
/**
- *
+ *
*/
public AbstractState(String name) {
this.name = name;
}
- @Override
+ @Override
public String getName() {
return name;
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -47,8 +47,8 @@ public abstract class AbstractState implements State {
public String toString() {
return getClass().getSimpleName()+": name=["+name+"]";
}
-
- @Override
+
+ @Override
public abstract FlowExecutionStatus handle(FlowExecutor executor) throws Exception;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/DecisionState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/DecisionState.java
index 687a9efaa..704ebba5b 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/DecisionState.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/DecisionState.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import org.springframework.batch.core.job.flow.JobExecutionDecider;
/**
* State that requires a decider to make the status decision.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -42,11 +42,11 @@ public class DecisionState extends AbstractState {
public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
return decider.decide(executor.getJobExecution(), executor.getStepExecution());
}
-
+
/* (non-Javadoc)
* @see org.springframework.batch.core.job.flow.State#isEndState()
*/
- @Override
+ @Override
public boolean isEndState() {
return false;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/EndState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/EndState.java
index 7cabbc553..c8782ff31 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/EndState.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/EndState.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ import org.springframework.batch.core.job.flow.State;
/**
* {@link State} implementation for ending a job if it is in progress and
* continuing if just starting.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -58,7 +58,7 @@ public class EndState extends AbstractState {
* @param name The name of the state
* @param abandon flag to indicate that previous step execution can be
* marked as abandoned (if there is one)
- *
+ *
*/
public EndState(FlowExecutionStatus status, String code, String name, boolean abandon) {
super(name);
@@ -69,7 +69,7 @@ public class EndState extends AbstractState {
/**
* Return the {@link FlowExecutionStatus} stored.
- *
+ *
* @see State#handle(FlowExecutor)
*/
@Override
@@ -116,17 +116,17 @@ public class EndState extends AbstractState {
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.job.flow.State#isEndState()
*/
- @Override
+ @Override
public boolean isEndState() {
return !status.isStop();
}
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#toString()
*/
@Override
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/FlowState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/FlowState.java
index 238ff8ad5..4c75971e9 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/FlowState.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/FlowState.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import org.springframework.batch.core.job.flow.FlowHolder;
/**
* State that delegates to a Flow
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -41,11 +41,11 @@ public class FlowState extends AbstractState implements FlowHolder {
super(name);
this.flow = flow;
}
-
+
/**
* @return the flows
*/
- @Override
+ @Override
public Collection getFlows() {
return Collections.singleton(flow);
}
@@ -54,11 +54,11 @@ public class FlowState extends AbstractState implements FlowHolder {
public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
return flow.start(executor).getStatus();
}
-
+
/* (non-Javadoc)
* @see org.springframework.batch.core.job.flow.State#isEndState()
*/
- @Override
+ @Override
public boolean isEndState() {
return false;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/MaxValueFlowExecutionAggregator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/MaxValueFlowExecutionAggregator.java
index 1a25a9be0..b66b3e275 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/MaxValueFlowExecutionAggregator.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/MaxValueFlowExecutionAggregator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import org.springframework.batch.core.job.flow.FlowExecutionStatus;
* {@link FlowExecutionStatus}', using the status with the high precedence as the
* aggregate status. See {@link FlowExecutionStatus} for details on status
* precedence.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -36,10 +36,10 @@ public class MaxValueFlowExecutionAggregator implements FlowExecutionAggregator
* Aggregate all of the {@link FlowExecutionStatus}es of the
* {@link FlowExecution}s into one status. The aggregate status will be the
* status with the highest precedence.
- *
+ *
* @see FlowExecutionAggregator#aggregate(Collection)
*/
- @Override
+ @Override
public FlowExecutionStatus aggregate(Collection executions) {
if (executions == null || executions.size() == 0) {
return FlowExecutionStatus.UNKNOWN;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/SplitState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/SplitState.java
index 459bb9404..a5e7ed3ae 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/SplitState.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/SplitState.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ import org.springframework.core.task.TaskRejectedException;
/**
* A {@link State} implementation that splits a {@link Flow} into multiple
* parallel subflows.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -63,11 +63,11 @@ public class SplitState extends AbstractState implements FlowHolder {
public void setTaskExecutor(TaskExecutor taskExecutor) {
this.taskExecutor = taskExecutor;
}
-
+
/**
* @return the flows
*/
- @Override
+ @Override
public Collection getFlows() {
return flows;
}
@@ -75,7 +75,7 @@ public class SplitState extends AbstractState implements FlowHolder {
/**
* Execute the flows in parallel by passing them to the {@link TaskExecutor}
* and wait for all of them to finish before proceeding.
- *
+ *
* @see State#handle(FlowExecutor)
*/
@Override
@@ -88,7 +88,7 @@ public class SplitState extends AbstractState implements FlowHolder {
for (final Flow flow : flows) {
final FutureTask task = new FutureTask(new Callable() {
- @Override
+ @Override
public FlowExecution call() throws Exception {
return flow.start(executor);
}
@@ -129,10 +129,10 @@ public class SplitState extends AbstractState implements FlowHolder {
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.job.flow.State#isEndState()
*/
- @Override
+ @Override
public boolean isEndState() {
return false;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/StepState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/StepState.java
index 36ce9a334..b319908b4 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/StepState.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/StepState.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ import org.springframework.batch.core.step.StepHolder;
/**
* {@link State} implementation that delegates to a {@link FlowExecutor} to
* execute the specified {@link Step}.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -63,15 +63,15 @@ public class StepState extends AbstractState implements StepHolder {
/**
* @return the step
*/
- @Override
+ @Override
public Step getStep() {
return step;
}
-
+
/* (non-Javadoc)
* @see org.springframework.batch.core.job.flow.State#isEndState()
*/
- @Override
+ @Override
public boolean isEndState() {
return false;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java
index dabe77af0..0cffcdfd7 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JobRegistryBackgroundJobRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ import org.springframework.util.Assert;
* jobs registered, e.g. a JMX MBean wrapper for a {@link JobLauncher}, or a
* Quartz trigger.
*
- *
+ *
*
* With any launch of a batch job within Spring Batch, a Spring context
* containing the {@link Job} has to be created. Using this launcher, the jobs
@@ -56,9 +56,9 @@ import org.springframework.util.Assert;
* {@link JobRegistry}. Therefore, if autowiring fails to set it then an
* exception will be thrown.
*
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class JobRegistryBackgroundJobRunner {
@@ -93,16 +93,16 @@ public class JobRegistryBackgroundJobRunner {
/**
* A loader for the jobs that are going to be registered.
- *
+ *
* @param jobLoader the {@link JobLoader} to set
*/
public void setJobLoader(JobLoader jobLoader) {
this.jobLoader = jobLoader;
}
-
+
/**
* A job registry that can be used to create a job loader (if none is provided).
- *
+ *
* @param jobRegistry the {@link JobRegistry} to set
*/
public void setJobRegistry(JobRegistry jobRegistry) {
@@ -155,7 +155,7 @@ public class JobRegistryBackgroundJobRunner {
String[] names = parentContext.getBeanNamesForType(JobLoader.class);
if (names.length == 0) {
if (parentContext.containsBean("jobLoader")) {
- jobLoader = (JobLoader) parentContext.getBean("jobLoader", JobLoader.class);
+ jobLoader = parentContext.getBean("jobLoader", JobLoader.class);
return;
}
if (jobRegistry != null) {
@@ -164,7 +164,7 @@ public class JobRegistryBackgroundJobRunner {
}
}
- jobLoader = (JobLoader) parentContext.getBean(names[0], JobLoader.class);
+ jobLoader = parentContext.getBean(names[0], JobLoader.class);
return;
}
@@ -175,20 +175,20 @@ public class JobRegistryBackgroundJobRunner {
* {@link JobRegistry} and the child contexts are expected to contain
* {@link Job} definitions, each of which will be registered wit the
* registry.
- *
+ *
* Example usage:
- *
+ *
*
* $ java -classpath ... JobRegistryBackgroundJobRunner job-registry-context.xml job1.xml job2.xml ...
*
- *
+ *
* The child contexts are created only when needed though the
* {@link JobFactory} interface (but the XML is validated on startup by
* using it to create a {@link BeanFactory} which is then discarded).
- *
+ *
* The parent context is created in a separate thread, and the program will
* pause for input in an infinite loop until the user hits any key.
- *
+ *
* @param args the context locations to use (first one is for parent)
* @throws Exception if anything goes wrong with the context creation
*/
@@ -202,7 +202,7 @@ public class JobRegistryBackgroundJobRunner {
logger.info("Starting job registry in parent context from XML at: [" + args[0] + "]");
new Thread(new Runnable() {
- @Override
+ @Override
public void run() {
try {
launcher.run();
@@ -241,7 +241,7 @@ public class JobRegistryBackgroundJobRunner {
synchronized (JobRegistryBackgroundJobRunner.class) {
System.out
- .println("Started application. Interrupt (CTRL-C) or call JobRegistryBackgroundJobRunner.stop() to exit.");
+ .println("Started application. Interrupt (CTRL-C) or call JobRegistryBackgroundJobRunner.stop() to exit.");
JobRegistryBackgroundJobRunner.class.wait();
}
launcher.destroy();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JvmSystemExiter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JvmSystemExiter.java
index 6d3b6d8d9..733d15b04 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JvmSystemExiter.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/JvmSystemExiter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,10 +20,10 @@ package org.springframework.batch.core.launch.support;
* System.exit method. It should be noted that there will be no unit tests for
* this class, since there is only one line of actual code, that would only be
* testable by mocking System or Runtime.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
- *
+ *
*/
public class JvmSystemExiter implements SystemExiter {
@@ -31,10 +31,10 @@ public class JvmSystemExiter implements SystemExiter {
* Delegate call to System.exit() with the argument provided. This should only
* be used in a scenario where a particular status needs to be returned to
* a Batch scheduler.
- *
+ *
* @see org.springframework.batch.core.launch.support.SystemExiter#exit(int)
*/
- @Override
+ @Override
public void exit(int status) {
System.exit(status);
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RunIdIncrementer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RunIdIncrementer.java
index 9a0d8f82d..25abace0a 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RunIdIncrementer.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RunIdIncrementer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,12 +25,12 @@ import org.springframework.batch.core.JobParametersIncrementer;
public class RunIdIncrementer implements JobParametersIncrementer {
private static String RUN_ID_KEY = "run.id";
-
+
private String key = RUN_ID_KEY;
-
+
/**
* The name of the run id in the job parameters. Defaults to "run.id".
- *
+ *
* @param key the key to set
*/
public void setKey(String key) {
@@ -40,11 +40,11 @@ public class RunIdIncrementer implements JobParametersIncrementer {
/**
* Increment the run.id parameter (starting with 1).
*/
- @Override
+ @Override
public JobParameters getNext(JobParameters parameters) {
-
+
JobParameters params = (parameters == null) ? new JobParameters() : parameters;
-
+
long id = params.getLong(key, 0L) + 1;
return new JobParametersBuilder(params).addLong(key, id).toJobParameters();
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RuntimeExceptionTranslator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RuntimeExceptionTranslator.java
index 352e43946..3b30b8bbf 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RuntimeExceptionTranslator.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/RuntimeExceptionTranslator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ public class RuntimeExceptionTranslator implements MethodInterceptor {
/* (non-Javadoc)
* @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)
*/
- @Override
+ @Override
public Object invoke(MethodInvocation invocation) throws Throwable {
try {
return invocation.proceed();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ScheduledJobParametersFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ScheduledJobParametersFactory.java
index ee2fa4e7a..520990817 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ScheduledJobParametersFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/ScheduledJobParametersFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,8 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
-import java.util.Properties;
import java.util.Map.Entry;
+import java.util.Properties;
import org.springframework.batch.core.JobParameter;
import org.springframework.batch.core.JobParameters;
@@ -30,7 +30,7 @@ import org.springframework.batch.core.converter.JobParametersConverter;
/**
* @author Lucas Ward
- *
+ *
*/
public class ScheduledJobParametersFactory implements JobParametersConverter {
@@ -40,10 +40,10 @@ public class ScheduledJobParametersFactory implements JobParametersConverter {
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.runtime.JobParametersFactory#getJobParameters(java.util.Properties)
*/
- @Override
+ @Override
public JobParameters getJobParameters(Properties props) {
if (props == null || props.isEmpty()) {
@@ -71,10 +71,10 @@ public class ScheduledJobParametersFactory implements JobParametersConverter {
/**
* Convert schedule date to Date, and assume all other parameters can be represented by their default string value.
- *
+ *
* @see org.springframework.batch.core.converter.JobParametersConverter#getProperties(org.springframework.batch.core.JobParameters)
*/
- @Override
+ @Override
public Properties getProperties(JobParameters params) {
if (params == null || params.isEmpty()) {
@@ -97,7 +97,7 @@ public class ScheduledJobParametersFactory implements JobParametersConverter {
/**
* Public setter for injecting a date format.
- *
+ *
* @param dateFormat a {@link DateFormat}, defaults to "yyyy/MM/dd"
*/
public void setDateFormat(DateFormat dateFormat) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java
index 64e43a03d..68e3d2df3 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,18 +44,18 @@ import org.springframework.util.Assert;
* be taken to ensure any users of this class understand fully whether or not
* the implementation of TaskExecutor used will start tasks synchronously or
* asynchronously. The default setting uses a synchronous task executor.
- *
+ *
* There is only one required dependency of this Launcher, a
* {@link JobRepository}. The JobRepository is used to obtain a valid
* JobExecution. The Repository must be used because the provided {@link Job}
* could be a restart of an existing {@link JobInstance}, and only the
* Repository can reliably recreate it.
- *
+ *
* @author Lucas Ward
* @Author Dave Syer
- *
+ *
* @since 1.0
- *
+ *
* @see JobRepository
* @see TaskExecutor
*/
@@ -71,7 +71,7 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean {
* Run the provided job with the given {@link JobParameters}. The
* {@link JobParameters} will be used to determine if this is an execution
* of an existing job instance, or if a new one should be created.
- *
+ *
* @param job the job to be run.
* @param jobParameters the {@link JobParameters} for this particular
* execution.
@@ -83,7 +83,7 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean {
* completed successfully
* @throws JobParametersInvalidException
*/
- @Override
+ @Override
public JobExecution run(final Job job, final JobParameters jobParameters)
throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
@@ -114,7 +114,7 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean {
try {
taskExecutor.execute(new Runnable() {
- @Override
+ @Override
public void run() {
try {
logger.info("Job: [" + job + "] launched with the following parameters: [" + jobParameters
@@ -155,7 +155,7 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean {
/**
* Set the JobRepsitory.
- *
+ *
* @param jobRepository
*/
public void setJobRepository(JobRepository jobRepository) {
@@ -164,7 +164,7 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean {
/**
* Set the TaskExecutor. (Optional)
- *
+ *
* @param taskExecutor
*/
public void setTaskExecutor(TaskExecutor taskExecutor) {
@@ -175,7 +175,7 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean {
* Ensure the required dependencies of a {@link JobRepository} have been
* set.
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.state(jobRepository != null, "A JobRepository has not been set.");
if (taskExecutor == null) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobOperator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobOperator.java
index 75db5bb7e..c57c54492 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobOperator.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobOperator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,17 +58,17 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
/**
- * Simple implementation of the JobOperator interface. Due to the amount of
+ * Simple implementation of the JobOperator interface. Due to the amount of
* functionality the implementation is combining, the following dependencies
* are required:
- *
+ *
*
* - {@link JobLauncher}
*
- {@link JobExplorer}
*
- {@link JobRepository}
*
- {@link JobRegistry}
*
- *
+ *
* @author Dave Syer
* @author Lucas Ward
* @since 2.0
@@ -76,7 +76,7 @@ import org.springframework.util.Assert;
public class SimpleJobOperator implements JobOperator, InitializingBean {
/**
- *
+ *
*/
private static final String ILLEGAL_STATE_MSG = "Illegal state (only happens on a race condition): "
+ "%s with name=%s and parameters=%s";
@@ -95,10 +95,10 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/**
* Check mandatory properties.
- *
+ *
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(jobLauncher, "JobLauncher must be provided");
Assert.notNull(jobRegistry, "JobLocator must be provided");
@@ -144,10 +144,10 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.launch.JobOperator#getExecutions(java.lang.Long)
*/
- @Override
+ @Override
public List getExecutions(long instanceId) throws NoSuchJobInstanceException {
JobInstance jobInstance = jobExplorer.getJobInstance(instanceId);
if (jobInstance == null) {
@@ -162,20 +162,20 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.launch.JobOperator#getJobNames()
*/
- @Override
+ @Override
public Set getJobNames() {
return new TreeSet(jobRegistry.getJobNames());
}
/*
* (non-Javadoc)
- *
+ *
* @see JobOperator#getLastInstances(String, int, int)
*/
- @Override
+ @Override
public List getJobInstances(String jobName, int start, int count) throws NoSuchJobException {
List list = new ArrayList();
for (JobInstance jobInstance : jobExplorer.getJobInstances(jobName, start, count)) {
@@ -189,12 +189,12 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.launch.JobOperator#getParameters(java.
* lang.Long)
*/
- @Override
+ @Override
public String getParameters(long executionId) throws NoSuchJobExecutionException {
JobExecution jobExecution = findExecutionById(executionId);
@@ -204,12 +204,12 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.launch.JobOperator#getRunningExecutions
* (java.lang.String)
*/
- @Override
+ @Override
public Set getRunningExecutions(String jobName) throws NoSuchJobException {
Set set = new LinkedHashSet();
for (JobExecution jobExecution : jobExplorer.findRunningJobExecutions(jobName)) {
@@ -223,12 +223,12 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.launch.JobOperator#getStepExecutionSummaries
* (java.lang.Long)
*/
- @Override
+ @Override
public Map getStepExecutionSummaries(long executionId) throws NoSuchJobExecutionException {
JobExecution jobExecution = findExecutionById(executionId);
@@ -241,12 +241,12 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.launch.JobOperator#getSummary(java.lang
* .Long)
*/
- @Override
+ @Override
public String getSummary(long executionId) throws NoSuchJobExecutionException {
JobExecution jobExecution = findExecutionById(executionId);
return jobExecution.toString();
@@ -254,11 +254,11 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.launch.JobOperator#resume(java.lang.Long)
*/
- @Override
+ @Override
public Long restart(long executionId) throws JobInstanceAlreadyCompleteException, NoSuchJobExecutionException, NoSuchJobException, JobRestartException, JobParametersInvalidException {
logger.info("Checking status of job execution with id=" + executionId);
@@ -282,12 +282,12 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.launch.JobOperator#start(java.lang.String,
* java.lang.String)
*/
- @Override
+ @Override
public Long start(String jobName, String parameters) throws NoSuchJobException, JobInstanceAlreadyExistsException, JobParametersInvalidException {
logger.info("Checking status of job with name=" + jobName);
@@ -324,12 +324,12 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see JobOperator#startNextInstance(String )
*/
- @Override
+ @Override
public Long startNextInstance(String jobName) throws NoSuchJobException, JobParametersNotFoundException,
- UnexpectedJobExecutionException, JobParametersInvalidException {
+ UnexpectedJobExecutionException, JobParametersInvalidException {
logger.info("Locating parameters for next instance of job with name=" + jobName);
@@ -373,11 +373,11 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.launch.JobOperator#stop(java.lang.Long)
*/
- @Override
+ @Override
@Transactional
public boolean stop(long executionId) throws NoSuchJobExecutionException, JobExecutionNotRunningException {
@@ -395,22 +395,22 @@ public class SimpleJobOperator implements JobOperator, InitializingBean {
return true;
}
- @Override
- public JobExecution abandon(long jobExecutionId) throws NoSuchJobExecutionException, JobExecutionAlreadyRunningException {
- JobExecution jobExecution = findExecutionById(jobExecutionId);
+ @Override
+ public JobExecution abandon(long jobExecutionId) throws NoSuchJobExecutionException, JobExecutionAlreadyRunningException {
+ JobExecution jobExecution = findExecutionById(jobExecutionId);
- if (jobExecution.getStatus().isLessThan(BatchStatus.STOPPING)) {
- throw new JobExecutionAlreadyRunningException(
- "JobExecution is running or complete and therefore cannot be aborted");
- }
+ if (jobExecution.getStatus().isLessThan(BatchStatus.STOPPING)) {
+ throw new JobExecutionAlreadyRunningException(
+ "JobExecution is running or complete and therefore cannot be aborted");
+ }
- logger.info("Aborting job execution: " + jobExecution);
- jobExecution.upgradeStatus(BatchStatus.ABANDONED);
- jobExecution.setEndTime(new Date());
- jobRepository.update(jobExecution);
+ logger.info("Aborting job execution: " + jobExecution);
+ jobExecution.upgradeStatus(BatchStatus.ABANDONED);
+ jobExecution.setEndTime(new Date());
+ jobRepository.update(jobExecution);
- return jobExecution;
- }
+ return jobExecution;
+ }
private JobExecution findExecutionById(long executionId) throws NoSuchJobExecutionException {
JobExecution jobExecution = jobExplorer.getJobExecution(executionId);
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJvmExitCodeMapper.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJvmExitCodeMapper.java
index a8337f362..e97776b24 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJvmExitCodeMapper.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJvmExitCodeMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import org.springframework.batch.core.ExitStatus;
* An implementation of {@link ExitCodeMapper} that can be configured through a
* map from batch exit codes (String) to integer results. Some default entries
* are set up to recognise common cases. Any that are injected are added to these.
- *
+ *
* @author Stijn Maller
* @author Lucas Ward
* @author Dave Syer
@@ -67,7 +67,7 @@ public class SimpleJvmExitCodeMapper implements ExitCodeMapper {
* Framework
* @return The exitCode of the Batch Job as known by the JVM
*/
- @Override
+ @Override
public int intValue(String exitCode) {
Integer statusCode = null;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/AbstractListenerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/AbstractListenerFactoryBean.java
index de6f06211..23604e4e4 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/AbstractListenerFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/AbstractListenerFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ import org.springframework.util.Assert;
* {@link FactoryBean} implementation that builds a listener based on the
* various lifecycle methods or annotations that are provided. There are three
* possible ways of having a method called as part of a listener lifecycle:
- *
+ *
*
* - Interface implementation: By implementing any of the subclasses of a
* listener interface, methods on said interface will be called
@@ -47,7 +47,7 @@ import org.springframework.util.Assert;
*
- String name of the method to be called, which is tied to a
* {@link ListenerMetaData} value in the metaDataMap.
*
- *
+ *
* It should be noted that methods obtained by name or annotation that don't
* match the listener method signatures to which they belong will cause errors.
* However, it is acceptable to have no parameters at all. If the same method is
@@ -56,19 +56,20 @@ import org.springframework.util.Assert;
* has multiple methods tied to a particular listener, each method will be
* called. Also note that the same annotations cannot be applied to two separate
* methods in a single class.
- *
+ *
* @author Lucas Ward
* @author Dan Garrette
* @since 2.0
* @see ListenerMetaData
*/
+@SuppressWarnings("rawtypes")
public abstract class AbstractListenerFactoryBean implements FactoryBean, InitializingBean {
private Object delegate;
private Map metaDataMap;
- @Override
+ @Override
public Object getObject() {
if (metaDataMap == null) {
@@ -102,7 +103,7 @@ public abstract class AbstractListenerFactoryBean implements FactoryBean, Initia
if (invoker != null) {
invokers.add(invoker);
}
-
+
invoker = getMethodInvokerByName(entry.getValue(), delegate, metaData.getParamTypes());
if (invoker != null) {
invokers.add(invoker);
@@ -175,7 +176,7 @@ public abstract class AbstractListenerFactoryBean implements FactoryBean, Initia
}
}
- @Override
+ @Override
public boolean isSingleton() {
return true;
}
@@ -188,7 +189,7 @@ public abstract class AbstractListenerFactoryBean implements FactoryBean, Initia
this.metaDataMap = metaDataMap;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(delegate, "Delegate must not be null");
}
@@ -196,7 +197,7 @@ public abstract class AbstractListenerFactoryBean implements FactoryBean, Initia
/**
* Convenience method to check whether the given object is or can be made
* into a listener.
- *
+ *
* @param target the object to check
* @return true if the delegate is an instance of any of the listener
* interface, or contains the marker annotations
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ChunkListenerSupport.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ChunkListenerSupport.java
index 5e9e55724..8d7979de5 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ChunkListenerSupport.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ChunkListenerSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import org.springframework.batch.core.ChunkListener;
/**
* Basic support implementation of {@link ChunkListener}
- *
+ *
* @author Lucas Ward
*
*/
@@ -28,14 +28,14 @@ public class ChunkListenerSupport implements ChunkListener {
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.ChunkListener#afterChunk()
*/
- @Override
+ @Override
public void afterChunk() {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.ChunkListener#beforeChunk()
*/
- @Override
+ @Override
public void beforeChunk() {
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeChunkListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeChunkListener.java
index a8b81b1a7..2109fba0b 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeChunkListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeChunkListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ import org.springframework.core.Ordered;
/**
* @author Lucas Ward
- *
+ *
*/
public class CompositeChunkListener implements ChunkListener {
@@ -31,7 +31,7 @@ public class CompositeChunkListener implements ChunkListener {
/**
* Public setter for the listeners.
- *
+ *
* @param listeners
*/
public void setListeners(List extends ChunkListener> listeners) {
@@ -40,7 +40,7 @@ public class CompositeChunkListener implements ChunkListener {
/**
* Register additional listener.
- *
+ *
* @param chunkListener
*/
public void register(ChunkListener chunkListener) {
@@ -50,10 +50,10 @@ public class CompositeChunkListener implements ChunkListener {
/**
* Call the registered listeners in order, respecting and prioritising those
* that implement {@link Ordered}.
- *
+ *
* @see org.springframework.batch.core.ChunkListener#afterChunk()
*/
- @Override
+ @Override
public void afterChunk() {
for (Iterator iterator = listeners.iterator(); iterator.hasNext();) {
ChunkListener listener = iterator.next();
@@ -63,10 +63,10 @@ public class CompositeChunkListener implements ChunkListener {
/**
* Call the registered listeners in reverse order.
- *
+ *
* @see org.springframework.batch.core.ChunkListener#beforeChunk()
*/
- @Override
+ @Override
public void beforeChunk() {
for (Iterator iterator = listeners.reverse(); iterator.hasNext();) {
ChunkListener listener = iterator.next();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemProcessListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemProcessListener.java
index deee4280d..8a85ac1fb 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemProcessListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemProcessListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ import org.springframework.core.Ordered;
/**
* @author Dave Syer
- *
+ *
*/
public class CompositeItemProcessListener implements ItemProcessListener {
@@ -31,7 +31,7 @@ public class CompositeItemProcessListener implements ItemProcessListener> itemReadListeners) {
@@ -40,7 +40,7 @@ public class CompositeItemProcessListener implements ItemProcessListener itemReaderListener) {
@@ -53,7 +53,7 @@ public class CompositeItemProcessListener implements ItemProcessListener> iterator = listeners.reverse(); iterator.hasNext();) {
ItemProcessListener super T, ? super S> listener = iterator.next();
@@ -66,7 +66,7 @@ public class CompositeItemProcessListener implements ItemProcessListener> iterator = listeners.iterator(); iterator.hasNext();) {
ItemProcessListener super T, ? super S> listener = iterator.next();
@@ -80,7 +80,7 @@ public class CompositeItemProcessListener implements ItemProcessListener> iterator = listeners.reverse(); iterator.hasNext();) {
ItemProcessListener super T, ? super S> listener = iterator.next();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemReadListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemReadListener.java
index 428edf496..18c782bb7 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemReadListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemReadListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import org.springframework.core.Ordered;
/**
* @author Lucas Ward
* @author Dave Syer
- *
+ *
*/
public class CompositeItemReadListener implements ItemReadListener {
@@ -32,7 +32,7 @@ public class CompositeItemReadListener implements ItemReadListener {
/**
* Public setter for the listeners.
- *
+ *
* @param itemReadListeners
*/
public void setListeners(List extends ItemReadListener super T>> itemReadListeners) {
@@ -41,7 +41,7 @@ public class CompositeItemReadListener implements ItemReadListener {
/**
* Register additional listener.
- *
+ *
* @param itemReaderListener
*/
public void register(ItemReadListener super T> itemReaderListener) {
@@ -53,7 +53,7 @@ public class CompositeItemReadListener implements ItemReadListener {
* prioritising those that implement {@link Ordered}.
* @see org.springframework.batch.core.ItemReadListener#afterRead(java.lang.Object)
*/
- @Override
+ @Override
public void afterRead(T item) {
for (Iterator> iterator = listeners.reverse(); iterator.hasNext();) {
ItemReadListener super T> listener = iterator.next();
@@ -66,7 +66,7 @@ public class CompositeItemReadListener implements ItemReadListener {
* that implement {@link Ordered}.
* @see org.springframework.batch.core.ItemReadListener#beforeRead()
*/
- @Override
+ @Override
public void beforeRead() {
for (Iterator> iterator = listeners.iterator(); iterator.hasNext();) {
ItemReadListener super T> listener = iterator.next();
@@ -79,7 +79,7 @@ public class CompositeItemReadListener implements ItemReadListener {
* prioritising those that implement {@link Ordered}.
* @see org.springframework.batch.core.ItemReadListener#onReadError(java.lang.Exception)
*/
- @Override
+ @Override
public void onReadError(Exception ex) {
for (Iterator> iterator = listeners.iterator(); iterator.hasNext();) {
ItemReadListener super T> listener = iterator.next();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemWriteListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemWriteListener.java
index c3d32f17c..d7ecb635e 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemWriteListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeItemWriteListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import org.springframework.core.Ordered;
/**
* @author Lucas Ward
* @author Dave Syer
- *
+ *
*/
public class CompositeItemWriteListener implements ItemWriteListener {
@@ -32,7 +32,7 @@ public class CompositeItemWriteListener implements ItemWriteListener {
/**
* Public setter for the listeners.
- *
+ *
* @param itemWriteListeners
*/
public void setListeners(List extends ItemWriteListener super S>> itemWriteListeners) {
@@ -41,7 +41,7 @@ public class CompositeItemWriteListener implements ItemWriteListener {
/**
* Register additional listener.
- *
+ *
* @param itemWriteListener
*/
public void register(ItemWriteListener super S> itemWriteListener) {
@@ -53,7 +53,7 @@ public class CompositeItemWriteListener implements ItemWriteListener {
* prioritising those that implement {@link Ordered}.
* @see ItemWriteListener#afterWrite(java.util.List)
*/
- @Override
+ @Override
public void afterWrite(List extends S> items) {
for (Iterator> iterator = listeners.reverse(); iterator.hasNext();) {
ItemWriteListener super S> listener = iterator.next();
@@ -66,7 +66,7 @@ public class CompositeItemWriteListener implements ItemWriteListener {
* that implement {@link Ordered}.
* @see ItemWriteListener#beforeWrite(List)
*/
- @Override
+ @Override
public void beforeWrite(List extends S> items) {
for (Iterator> iterator = listeners.iterator(); iterator.hasNext();) {
ItemWriteListener super S> listener = iterator.next();
@@ -79,7 +79,7 @@ public class CompositeItemWriteListener implements ItemWriteListener {
* prioritising those that implement {@link Ordered}.
* @see ItemWriteListener#onWriteError(Exception, List)
*/
- @Override
+ @Override
public void onWriteError(Exception ex, List extends S> items) {
for (Iterator> iterator = listeners.reverse(); iterator.hasNext();) {
ItemWriteListener super S> listener = iterator.next();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeJobExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeJobExecutionListener.java
index 579a63f7d..699073ec4 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeJobExecutionListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeJobExecutionListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import org.springframework.core.Ordered;
/**
* @author Dave Syer
- *
+ *
*/
public class CompositeJobExecutionListener implements JobExecutionListener {
@@ -32,7 +32,7 @@ public class CompositeJobExecutionListener implements JobExecutionListener {
/**
* Public setter for the listeners.
- *
+ *
* @param listeners
*/
public void setListeners(List extends JobExecutionListener> listeners) {
@@ -41,7 +41,7 @@ public class CompositeJobExecutionListener implements JobExecutionListener {
/**
* Register additional listener.
- *
+ *
* @param jobExecutionListener
*/
public void register(JobExecutionListener jobExecutionListener) {
@@ -53,7 +53,7 @@ public class CompositeJobExecutionListener implements JobExecutionListener {
* prioritising those that implement {@link Ordered}.
* @see org.springframework.batch.core.JobExecutionListener#afterJob(org.springframework.batch.core.JobExecution)
*/
- @Override
+ @Override
public void afterJob(JobExecution jobExecution) {
for (Iterator iterator = listeners.reverse(); iterator.hasNext();) {
JobExecutionListener listener = iterator.next();
@@ -66,7 +66,7 @@ public class CompositeJobExecutionListener implements JobExecutionListener {
* that implement {@link Ordered}.
* @see org.springframework.batch.core.JobExecutionListener#beforeJob(org.springframework.batch.core.JobExecution)
*/
- @Override
+ @Override
public void beforeJob(JobExecution jobExecution) {
for (Iterator iterator = listeners.iterator(); iterator.hasNext();) {
JobExecutionListener listener = iterator.next();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeSkipListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeSkipListener.java
index 7b99d9cdd..2e39c4e6f 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeSkipListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeSkipListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ import org.springframework.core.Ordered;
/**
* @author Dave Syer
- *
+ *
*/
public class CompositeSkipListener implements SkipListener {
@@ -31,7 +31,7 @@ public class CompositeSkipListener implements SkipListener {
/**
* Public setter for the listeners.
- *
+ *
* @param listeners
*/
public void setListeners(List extends SkipListener super T,? super S>> listeners) {
@@ -40,7 +40,7 @@ public class CompositeSkipListener implements SkipListener {
/**
* Register additional listener.
- *
+ *
* @param listener
*/
public void register(SkipListener super T,? super S> listener) {
@@ -52,7 +52,7 @@ public class CompositeSkipListener implements SkipListener {
* that implement {@link Ordered}.
* @see org.springframework.batch.core.SkipListener#onSkipInRead(java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInRead(Throwable t) {
for (Iterator> iterator = listeners.iterator(); iterator.hasNext();) {
SkipListener super T,? super S> listener = iterator.next();
@@ -66,7 +66,7 @@ public class CompositeSkipListener implements SkipListener {
* @see org.springframework.batch.core.SkipListener#onSkipInWrite(java.lang.Object,
* java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInWrite(S item, Throwable t) {
for (Iterator> iterator = listeners.iterator(); iterator.hasNext();) {
SkipListener super T,? super S> listener = iterator.next();
@@ -80,7 +80,7 @@ public class CompositeSkipListener implements SkipListener {
* @see org.springframework.batch.core.SkipListener#onSkipInWrite(java.lang.Object,
* java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInProcess(T item, Throwable t) {
for (Iterator> iterator = listeners.iterator(); iterator.hasNext();) {
SkipListener super T,? super S> listener = iterator.next();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeStepExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeStepExecutionListener.java
index 12343bfd6..057295100 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeStepExecutionListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/CompositeStepExecutionListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import org.springframework.core.Ordered;
/**
* @author Lucas Ward
* @author Dave Syer
- *
+ *
*/
public class CompositeStepExecutionListener implements StepExecutionListener {
@@ -34,7 +34,7 @@ public class CompositeStepExecutionListener implements StepExecutionListener {
/**
* Public setter for the listeners.
- *
+ *
* @param listeners
*/
public void setListeners(StepExecutionListener[] listeners) {
@@ -43,7 +43,7 @@ public class CompositeStepExecutionListener implements StepExecutionListener {
/**
* Register additional listener.
- *
+ *
* @param stepExecutionListener
*/
public void register(StepExecutionListener stepExecutionListener) {
@@ -52,10 +52,10 @@ public class CompositeStepExecutionListener implements StepExecutionListener {
/**
* Call the registered listeners in reverse order, respecting and
- * prioritising those that implement {@link Ordered}.
+ * prioritizing those that implement {@link Ordered}.
* @see org.springframework.batch.core.StepExecutionListener#afterStep(StepExecution)
*/
- @Override
+ @Override
public ExitStatus afterStep(StepExecution stepExecution) {
ExitStatus status = null;
for (Iterator iterator = list.reverse(); iterator.hasNext();) {
@@ -67,11 +67,11 @@ public class CompositeStepExecutionListener implements StepExecutionListener {
}
/**
- * Call the registered listeners in order, respecting and prioritising those
+ * Call the registered listeners in order, respecting and prioritizing those
* that implement {@link Ordered}.
* @see org.springframework.batch.core.StepExecutionListener#beforeStep(StepExecution)
*/
- @Override
+ @Override
public void beforeStep(StepExecution stepExecution) {
for (Iterator iterator = list.iterator(); iterator.hasNext();) {
StepExecutionListener listener = iterator.next();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ExecutionContextPromotionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ExecutionContextPromotionListener.java
index 6b5cbb6e7..0f55912ae 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ExecutionContextPromotionListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ExecutionContextPromotionListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,12 +29,12 @@ import org.springframework.util.Assert;
* {@link ExecutionContext} to the {@link Job} {@link ExecutionContext} at the
* end of a step. A list of keys should be provided that correspond to the items
* in the {@link Step} {@link ExecutionContext} that should be promoted.
- *
+ *
* Additionally, an optional list of statuses can be set to indicate for which
* exit status codes the promotion should occur. These statuses will be checked
* using the {@link PatternMatcher}, so wildcards are allowed. By default,
* promotion will only occur for steps with an exit code of "COMPLETED".
- *
+ *
* @author Dan Garrette
* @since 2.0
*/
@@ -46,7 +46,7 @@ public class ExecutionContextPromotionListener extends StepExecutionListenerSupp
private boolean strict = false;
- @Override
+ @Override
public ExitStatus afterStep(StepExecution stepExecution) {
ExecutionContext stepContext = stepExecution.getExecutionContext();
ExecutionContext jobContext = stepExecution.getJobExecution().getExecutionContext();
@@ -60,7 +60,7 @@ public class ExecutionContextPromotionListener extends StepExecutionListenerSupp
if (strict) {
throw new IllegalArgumentException("The key [" + key
+ "] was not found in the Step's ExecutionContext.");
- }
+ }
}
}
break;
@@ -70,7 +70,7 @@ public class ExecutionContextPromotionListener extends StepExecutionListenerSupp
return null;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(this.keys, "The 'keys' property must be provided");
Assert.notEmpty(this.keys, "The 'keys' property must not be empty");
@@ -98,7 +98,7 @@ public class ExecutionContextPromotionListener extends StepExecutionListenerSupp
/**
* If set to TRUE, the listener will throw an exception if any 'key' is not
* found in the Step {@link ExecutionContext}. FALSE by default.
- *
+ *
* @param strict
*/
public void setStrict(boolean strict) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ItemListenerSupport.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ItemListenerSupport.java
index c0a2da608..4b305a5b5 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ItemListenerSupport.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/ItemListenerSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,93 +26,93 @@ import org.springframework.batch.core.ItemWriteListener;
* {@link ItemProcessListener}, and {@link ItemWriteListener} interfaces. All
* are implemented, since it is very common that all may need to be implemented
* at once.
- *
+ *
* @author Lucas Ward
- *
+ *
*/
public class ItemListenerSupport implements ItemReadListener, ItemProcessListener, ItemWriteListener {
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.domain.ItemReadListener#afterRead(java.lang.Object)
*/
- @Override
+ @Override
public void afterRead(I item) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.domain.ItemReadListener#beforeRead()
*/
- @Override
+ @Override
public void beforeRead() {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.domain.ItemReadListener#onReadError(java.lang.Exception)
*/
- @Override
+ @Override
public void onReadError(Exception ex) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.ItemProcessListener#afterProcess(java.lang.Object,
* java.lang.Object)
*/
- @Override
+ @Override
public void afterProcess(I item, O result) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.ItemProcessListener#beforeProcess(java.lang.Object)
*/
- @Override
+ @Override
public void beforeProcess(I item) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.ItemProcessListener#onProcessError(java.lang.Object,
* java.lang.Exception)
*/
- @Override
+ @Override
public void onProcessError(I item, Exception e) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.domain.ItemWriteListener#afterWrite()
*/
- @Override
+ @Override
public void afterWrite(List extends O> item) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.domain.ItemWriteListener#beforeWrite(java.lang.Object)
*/
- @Override
+ @Override
public void beforeWrite(List extends O> item) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.springframework.batch.core.domain.ItemWriteListener#onWriteError(java.lang.Exception,
* java.lang.Object)
*/
- @Override
+ @Override
public void onWriteError(Exception ex, List extends O> item) {
}
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobExecutionListenerSupport.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobExecutionListenerSupport.java
index 2e9d5239f..94ea48984 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobExecutionListenerSupport.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobExecutionListenerSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,14 +27,14 @@ public class JobExecutionListenerSupport implements JobExecutionListener {
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.JobListener#afterJob()
*/
- @Override
+ @Override
public void afterJob(JobExecution jobExecution) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.JobListener#beforeJob(org.springframework.batch.core.domain.JobExecution)
*/
- @Override
+ @Override
public void beforeJob(JobExecution jobExecution) {
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobListenerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobListenerFactoryBean.java
index e97f718da..bb39640fc 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobListenerFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobListenerFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import org.springframework.batch.core.JobExecutionListener;
/**
* This {@link AbstractListenerFactoryBean} implementation is used to create a
* {@link JobExecutionListener}.
- *
+ *
* @author Lucas Ward
* @author Dan Garrette
* @since 2.0
@@ -29,22 +29,22 @@ import org.springframework.batch.core.JobExecutionListener;
*/
public class JobListenerFactoryBean extends AbstractListenerFactoryBean {
- @Override
+ @Override
protected ListenerMetaData getMetaDataFromPropertyName(String propertyName) {
return JobListenerMetaData.fromPropertyName(propertyName);
}
- @Override
+ @Override
protected ListenerMetaData[] getMetaDataValues() {
return JobListenerMetaData.values();
}
- @Override
+ @Override
protected Class> getDefaultListenerClass() {
return JobExecutionListener.class;
}
- @Override
+ @Override
public Class> getObjectType() {
return JobExecutionListener.class;
}
@@ -52,7 +52,7 @@ public class JobListenerFactoryBean extends AbstractListenerFactoryBean {
/**
* Convenience method to wrap any object and expose the appropriate
* {@link JobExecutionListener} interfaces.
- *
+ *
* @param delegate a delegate object
* @return a JobListener instance constructed from the delegate
*/
@@ -65,7 +65,7 @@ public class JobListenerFactoryBean extends AbstractListenerFactoryBean {
/**
* Convenience method to check whether the given object is or can be made
* into a {@link JobExecutionListener}.
- *
+ *
* @param delegate the object to check
* @return true if the delegate is an instance of
* {@link JobExecutionListener}, or contains the marker annotations
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobListenerMetaData.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobListenerMetaData.java
index 78404a1d8..14d0bd737 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobListenerMetaData.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/JobListenerMetaData.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import org.springframework.batch.core.annotation.BeforeJob;
/**
* Enumeration for {@link JobExecutionListener} meta data, which ties together the names
* of methods, their interfaces, annotation, and expected arguments.
- *
+ *
* @author Lucas Ward
* @since 2.0
* @see JobListenerFactoryBean
@@ -36,19 +36,19 @@ public enum JobListenerMetaData implements ListenerMetaData {
BEFORE_JOB("beforeJob", "before-job-method", BeforeJob.class),
AFTER_JOB("afterJob", "after-job-method", AfterJob.class);
-
-
+
+
private final String methodName;
private final String propertyName;
private final Class extends Annotation> annotation;
private static final Map propertyMap;
-
+
JobListenerMetaData(String methodName, String propertyName, Class extends Annotation> annotation) {
this.methodName = methodName;
this.propertyName = propertyName;
this.annotation = annotation;
}
-
+
static{
propertyMap = new HashMap();
for(JobListenerMetaData metaData : values()){
@@ -56,34 +56,34 @@ public enum JobListenerMetaData implements ListenerMetaData {
}
}
- @Override
+ @Override
public String getMethodName() {
return methodName;
}
- @Override
+ @Override
public Class extends Annotation> getAnnotation() {
return annotation;
}
- @Override
+ @Override
public Class> getListenerInterface() {
return JobExecutionListener.class;
}
-
- @Override
+
+ @Override
public String getPropertyName() {
return propertyName;
}
-
- @Override
+
+ @Override
public Class>[] getParamTypes() {
return new Class>[]{ JobExecution.class };
}
/**
* Return the relevant meta data for the provided property name.
- *
+ *
* @param propertyName
* @return meta data with supplied property name, null if none exists.
*/
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/MethodInvokerMethodInterceptor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/MethodInvokerMethodInterceptor.java
index 993f5bb9b..ef2673730 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/MethodInvokerMethodInterceptor.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/MethodInvokerMethodInterceptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import org.springframework.batch.support.MethodInvoker;
* that isn't void is
* {@link StepExecutionListener#afterStep(org.springframework.batch.core.StepExecution)}
* , which returns ExitStatus.
- *
+ *
* @author Lucas Ward
* @since 2.0
* @see MethodInvoker
@@ -51,7 +51,7 @@ public class MethodInvokerMethodInterceptor implements MethodInterceptor {
this.invokerMap = invokerMap;
}
- @Override
+ @Override
public Object invoke(MethodInvocation invocation) throws Throwable {
String methodName = invocation.getMethod().getName();
@@ -92,7 +92,7 @@ public class MethodInvokerMethodInterceptor implements MethodInterceptor {
MethodInvokerMethodInterceptor other = (MethodInvokerMethodInterceptor) obj;
return invokerMap.equals(other.invokerMap);
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/MulticasterBatchListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/MulticasterBatchListener.java
index bebc48d5b..83eb33171 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/MulticasterBatchListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/MulticasterBatchListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2012 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ import org.springframework.batch.item.ItemStream;
* @author Michael Minella
*/
public class MulticasterBatchListener implements StepExecutionListener, ChunkListener, ItemReadListener,
- ItemProcessListener, ItemWriteListener, SkipListener {
+ItemProcessListener, ItemWriteListener, SkipListener {
private CompositeStepExecutionListener stepListener = new CompositeStepExecutionListener();
@@ -106,7 +106,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @see org.springframework.batch.core.listener.CompositeItemProcessListener#afterProcess(java.lang.Object,
* java.lang.Object)
*/
- @Override
+ @Override
public void afterProcess(T item, S result) {
try {
itemProcessListener.afterProcess(item, result);
@@ -120,7 +120,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @param item
* @see org.springframework.batch.core.listener.CompositeItemProcessListener#beforeProcess(java.lang.Object)
*/
- @Override
+ @Override
public void beforeProcess(T item) {
try {
itemProcessListener.beforeProcess(item);
@@ -136,7 +136,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @see org.springframework.batch.core.listener.CompositeItemProcessListener#onProcessError(java.lang.Object,
* java.lang.Exception)
*/
- @Override
+ @Override
public void onProcessError(T item, Exception ex) {
try {
itemProcessListener.onProcessError(item, ex);
@@ -149,7 +149,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
/**
* @see org.springframework.batch.core.listener.CompositeStepExecutionListener#afterStep(StepExecution)
*/
- @Override
+ @Override
public ExitStatus afterStep(StepExecution stepExecution) {
try {
return stepListener.afterStep(stepExecution);
@@ -163,7 +163,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @param stepExecution
* @see org.springframework.batch.core.listener.CompositeStepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution)
*/
- @Override
+ @Override
public void beforeStep(StepExecution stepExecution) {
try {
stepListener.beforeStep(stepExecution);
@@ -177,7 +177,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
*
* @see org.springframework.batch.core.listener.CompositeChunkListener#afterChunk()
*/
- @Override
+ @Override
public void afterChunk() {
try {
chunkListener.afterChunk();
@@ -191,7 +191,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
*
* @see org.springframework.batch.core.listener.CompositeChunkListener#beforeChunk()
*/
- @Override
+ @Override
public void beforeChunk() {
try {
chunkListener.beforeChunk();
@@ -205,7 +205,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @param item
* @see org.springframework.batch.core.listener.CompositeItemReadListener#afterRead(java.lang.Object)
*/
- @Override
+ @Override
public void afterRead(T item) {
try {
itemReadListener.afterRead(item);
@@ -219,7 +219,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
*
* @see org.springframework.batch.core.listener.CompositeItemReadListener#beforeRead()
*/
- @Override
+ @Override
public void beforeRead() {
try {
itemReadListener.beforeRead();
@@ -233,7 +233,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @param ex
* @see org.springframework.batch.core.listener.CompositeItemReadListener#onReadError(java.lang.Exception)
*/
- @Override
+ @Override
public void onReadError(Exception ex) {
try {
itemReadListener.onReadError(ex);
@@ -247,7 +247,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
*
* @see ItemWriteListener#afterWrite(List)
*/
- @Override
+ @Override
public void afterWrite(List extends S> items) {
try {
itemWriteListener.afterWrite(items);
@@ -261,7 +261,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @param items
* @see ItemWriteListener#beforeWrite(List)
*/
- @Override
+ @Override
public void beforeWrite(List extends S> items) {
try {
itemWriteListener.beforeWrite(items);
@@ -276,7 +276,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @param items
* @see ItemWriteListener#onWriteError(Exception, List)
*/
- @Override
+ @Override
public void onWriteError(Exception ex, List extends S> items) {
try {
itemWriteListener.onWriteError(ex, items);
@@ -290,7 +290,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @param t
* @see org.springframework.batch.core.listener.CompositeSkipListener#onSkipInRead(java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInRead(Throwable t) {
skipListener.onSkipInRead(t);
}
@@ -301,7 +301,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @see org.springframework.batch.core.listener.CompositeSkipListener#onSkipInWrite(java.lang.Object,
* java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInWrite(S item, Throwable t) {
skipListener.onSkipInWrite(item, t);
}
@@ -312,7 +312,7 @@ public class MulticasterBatchListener implements StepExecutionListener, Ch
* @see org.springframework.batch.core.listener.CompositeSkipListener#onSkipInProcess(Object,
* Throwable)
*/
- @Override
+ @Override
public void onSkipInProcess(T item, Throwable t) {
skipListener.onSkipInProcess(item, t);
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/SkipListenerSupport.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/SkipListenerSupport.java
index 185c96b73..4afc57d9d 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/SkipListenerSupport.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/SkipListenerSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import org.springframework.batch.core.SkipListener;
/**
* Basic no-op implementations of all {@link SkipListener} implementations.
- *
+ *
* @author Dave Syer
*
*/
@@ -28,21 +28,21 @@ public class SkipListenerSupport implements SkipListener {
/* (non-Javadoc)
* @see org.springframework.batch.core.SkipListener#onSkipInRead(java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInRead(Throwable t) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.SkipListener#onSkipInWrite(java.lang.Object, java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInWrite(S item, Throwable t) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.SkipListener#onSkipInProcess(java.lang.Object, java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInProcess(T item, Throwable t) {
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepExecutionListenerSupport.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepExecutionListenerSupport.java
index d22d2511c..d87b01c12 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepExecutionListenerSupport.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepExecutionListenerSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class StepExecutionListenerSupport implements StepExecutionListener {
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.StepListener#afterStep(StepExecution stepExecution)
*/
- @Override
+ @Override
public ExitStatus afterStep(StepExecution stepExecution) {
return null;
}
@@ -36,7 +36,7 @@ public class StepExecutionListenerSupport implements StepExecutionListener {
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.StepListener#open(org.springframework.batch.item.ExecutionContext)
*/
- @Override
+ @Override
public void beforeStep(StepExecution stepExecution) {
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerFactoryBean.java
index 1dc526c65..e77ef8a60 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import org.springframework.batch.core.StepListener;
/**
* This {@link AbstractListenerFactoryBean} implementation is used to create a
* {@link StepListener}.
- *
+ *
* @author Lucas Ward
* @author Dan Garrette
* @since 2.0
@@ -29,22 +29,22 @@ import org.springframework.batch.core.StepListener;
*/
public class StepListenerFactoryBean extends AbstractListenerFactoryBean {
- @Override
+ @Override
protected ListenerMetaData getMetaDataFromPropertyName(String propertyName) {
return StepListenerMetaData.fromPropertyName(propertyName);
}
- @Override
+ @Override
protected ListenerMetaData[] getMetaDataValues() {
return StepListenerMetaData.values();
}
- @Override
+ @Override
protected Class> getDefaultListenerClass() {
return StepListener.class;
}
- @Override
+ @Override
@SuppressWarnings("rawtypes")
public Class getObjectType() {
return StepListener.class;
@@ -53,7 +53,7 @@ public class StepListenerFactoryBean extends AbstractListenerFactoryBean {
/**
* Convenience method to wrap any object and expose the appropriate
* {@link StepListener} interfaces.
- *
+ *
* @param delegate a delegate object
* @return a StepListener instance constructed from the delegate
*/
@@ -66,7 +66,7 @@ public class StepListenerFactoryBean extends AbstractListenerFactoryBean {
/**
* Convenience method to check whether the given object is or can be made
* into a {@link StepListener}.
- *
+ *
* @param delegate the object to check
* @return true if the delegate is an instance of any of the
* {@link StepListener} interfaces, or contains the marker
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerMetaData.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerMetaData.java
index 21d2fc035..50a23c371 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerMetaData.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerMetaData.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ import org.springframework.batch.core.annotation.OnWriteError;
/**
* Enumeration for {@link StepListener} meta data, which ties together the names
* of methods, their interfaces, annotation, and expected arguments.
- *
+ *
* @author Lucas Ward
* @since 2.0
* @see StepListenerFactoryBean
@@ -71,14 +71,14 @@ public enum StepListenerMetaData implements ListenerMetaData {
ON_SKIP_IN_READ("onSkipInRead", "on-skip-in-read-method", OnSkipInRead.class, SkipListener.class, Throwable.class),
ON_SKIP_IN_PROCESS("onSkipInProcess", "on-skip-in-process-method", OnSkipInProcess.class, SkipListener.class, Object.class, Throwable.class),
ON_SKIP_IN_WRITE("onSkipInWrite", "on-skip-in-write-method", OnSkipInWrite.class, SkipListener.class, Object.class, Throwable.class);
-
+
private final String methodName;
private final String propertyName;
private final Class extends Annotation> annotation;
private final Class extends StepListener> listenerInterface;
private final Class>[] paramTypes;
private static final Map propertyMap;
-
+
StepListenerMetaData(String methodName, String propertyName, Class extends Annotation> annotation, Class extends StepListener> listenerInterface, Class>... paramTypes) {
this.methodName = methodName;
this.propertyName = propertyName;
@@ -86,7 +86,7 @@ public enum StepListenerMetaData implements ListenerMetaData {
this.listenerInterface = listenerInterface;
this.paramTypes = paramTypes;
}
-
+
static{
propertyMap = new HashMap();
for(StepListenerMetaData metaData : values()){
@@ -94,41 +94,41 @@ public enum StepListenerMetaData implements ListenerMetaData {
}
}
- @Override
+ @Override
public String getMethodName() {
return methodName;
}
- @Override
+ @Override
public Class extends Annotation> getAnnotation() {
return annotation;
}
- @Override
+ @Override
public Class> getListenerInterface() {
return listenerInterface;
}
- @Override
+ @Override
public Class>[] getParamTypes() {
return paramTypes;
}
-
- @Override
+
+ @Override
public String getPropertyName() {
return propertyName;
}
-
+
/**
* Return the relevant meta data for the provided property name.
- *
+ *
* @param propertyName
* @return meta data with supplied property name, null if none exists.
*/
public static StepListenerMetaData fromPropertyName(String propertyName){
return propertyMap.get(propertyName);
}
-
+
public static ListenerMetaData[] itemListenerMetaData() {
return new ListenerMetaData[] {BEFORE_WRITE, AFTER_WRITE, ON_WRITE_ERROR, BEFORE_PROCESS, AFTER_PROCESS, ON_PROCESS_ERROR, BEFORE_READ, AFTER_READ, ON_READ_ERROR, ON_SKIP_IN_WRITE, ON_SKIP_IN_PROCESS, ON_SKIP_IN_READ};
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerSupport.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerSupport.java
index c415cca34..70d9d4028 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerSupport.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/StepListenerSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,17 +29,17 @@ import org.springframework.batch.core.StepListener;
/**
* Basic no-op implementations of all {@link StepListener} interfaces.
- *
+ *
* @author Lucas Ward
* @author Robert Kasanicky
*/
public class StepListenerSupport implements StepExecutionListener, ChunkListener,
- ItemReadListener, ItemProcessListener, ItemWriteListener, SkipListener {
+ItemReadListener, ItemProcessListener, ItemWriteListener, SkipListener {
/* (non-Javadoc)
* @see org.springframework.batch.core.StepExecutionListener#afterStep(org.springframework.batch.core.StepExecution)
*/
- @Override
+ @Override
public ExitStatus afterStep(StepExecution stepExecution) {
return null;
}
@@ -47,105 +47,105 @@ public class StepListenerSupport implements StepExecutionListener, ChunkLis
/* (non-Javadoc)
* @see org.springframework.batch.core.StepExecutionListener#beforeStep(org.springframework.batch.core.StepExecution)
*/
- @Override
+ @Override
public void beforeStep(StepExecution stepExecution) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.ChunkListener#afterChunk()
*/
- @Override
+ @Override
public void afterChunk() {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.ChunkListener#beforeChunk()
*/
- @Override
+ @Override
public void beforeChunk() {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.ItemReadListener#afterRead(java.lang.Object)
*/
- @Override
+ @Override
public void afterRead(T item) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.ItemReadListener#beforeRead()
*/
- @Override
+ @Override
public void beforeRead() {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.domain.ItemReadListener#onReadError(java.lang.Exception)
*/
- @Override
+ @Override
public void onReadError(Exception ex) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.ItemWriteListener#afterWrite(java.util.List)
*/
- @Override
+ @Override
public void afterWrite(List extends S> items) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.ItemWriteListener#beforeWrite(java.util.List)
*/
- @Override
+ @Override
public void beforeWrite(List extends S> items) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.ItemWriteListener#onWriteError(java.lang.Exception, java.util.List)
*/
- @Override
+ @Override
public void onWriteError(Exception exception, List extends S> items) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.ItemProcessListener#afterProcess(java.lang.Object, java.lang.Object)
*/
- @Override
+ @Override
public void afterProcess(T item, S result) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.ItemProcessListener#beforeProcess(java.lang.Object)
*/
- @Override
+ @Override
public void beforeProcess(T item) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.ItemProcessListener#onProcessError(java.lang.Object, java.lang.Exception)
*/
- @Override
+ @Override
public void onProcessError(T item, Exception e) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.SkipListener#onSkipInProcess(java.lang.Object, java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInProcess(T item, Throwable t) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.SkipListener#onSkipInRead(java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInRead(Throwable t) {
}
/* (non-Javadoc)
* @see org.springframework.batch.core.SkipListener#onSkipInWrite(java.lang.Object, java.lang.Throwable)
*/
- @Override
+ @Override
public void onSkipInWrite(S item, Throwable t) {
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/AbstractPartitionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/AbstractPartitionHandler.java
index 27cd42668..e75585efa 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/AbstractPartitionHandler.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/AbstractPartitionHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2012 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,43 +34,43 @@ import org.springframework.batch.core.partition.StepExecutionSplitter;
*/
public abstract class AbstractPartitionHandler implements PartitionHandler {
- private int gridSize = 1;
+ private int gridSize = 1;
- /**
- * Executes the specified {@link StepExecution} instances and returns an updated
- * view of them. Throws an {@link Exception} if anything goes wrong.
- *
- * @param masterStepExecution the whole partition execution
- * @param partitionStepExecutions the {@link StepExecution} instances to execute
- * @return an updated view of these completed {@link StepExecution} instances
- * @throws Exception if anything goes wrong. This allows implementations to
- * be liberal and rely on the caller to translate an exception into a step
- * failure as necessary.
- */
- protected abstract Set doHandle(StepExecution masterStepExecution,
- Set partitionStepExecutions) throws Exception;
+ /**
+ * Executes the specified {@link StepExecution} instances and returns an updated
+ * view of them. Throws an {@link Exception} if anything goes wrong.
+ *
+ * @param masterStepExecution the whole partition execution
+ * @param partitionStepExecutions the {@link StepExecution} instances to execute
+ * @return an updated view of these completed {@link StepExecution} instances
+ * @throws Exception if anything goes wrong. This allows implementations to
+ * be liberal and rely on the caller to translate an exception into a step
+ * failure as necessary.
+ */
+ protected abstract Set doHandle(StepExecution masterStepExecution,
+ Set partitionStepExecutions) throws Exception;
/**
* @see PartitionHandler#handle(StepExecutionSplitter, StepExecution)
*/
- @Override
- public Collection handle(final StepExecutionSplitter stepSplitter,
- final StepExecution masterStepExecution) throws Exception {
- final Set stepExecutions = stepSplitter.split(masterStepExecution, gridSize);
+ @Override
+ public Collection handle(final StepExecutionSplitter stepSplitter,
+ final StepExecution masterStepExecution) throws Exception {
+ final Set stepExecutions = stepSplitter.split(masterStepExecution, gridSize);
- return doHandle(masterStepExecution, stepExecutions);
- }
+ return doHandle(masterStepExecution, stepExecutions);
+ }
- /**
- * Returns the number of step executions.
- *
- * @return the number of step executions
- */
- public int getGridSize() {
- return gridSize;
- }
+ /**
+ * Returns the number of step executions.
+ *
+ * @return the number of step executions
+ */
+ public int getGridSize() {
+ return gridSize;
+ }
- /**
+ /**
* Passed to the {@link StepExecutionSplitter} in the
* {@link #handle(StepExecutionSplitter, StepExecution)} method, instructing
* it how many {@link StepExecution} instances are required, ideally. The
@@ -79,9 +79,9 @@ public abstract class AbstractPartitionHandler implements PartitionHandler {
*
* @param gridSize the number of step executions that will be created
*/
- public void setGridSize(int gridSize) {
- this.gridSize = gridSize;
- }
+ public void setGridSize(int gridSize) {
+ this.gridSize = gridSize;
+ }
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java
index 467545d9b..a293d4673 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/DefaultStepExecutionAggregator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import org.springframework.util.Assert;
/**
* Convenience class for aggregating a set of {@link StepExecution} instances
* into a single result.
- *
+ *
* @author Dave Syer
* @since 2.1
*/
@@ -43,7 +43,7 @@ public class DefaultStepExecutionAggregator implements StepExecutionAggregator {
*
* @see StepExecutionAggregator #aggregate(StepExecution, Collection)
*/
- @Override
+ @Override
public void aggregate(StepExecution result, Collection executions) {
Assert.notNull(result, "To aggregate into a result it must be non-null.");
if (executions == null) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/MultiResourcePartitioner.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/MultiResourcePartitioner.java
index 91ee19a23..03f3eef09 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/MultiResourcePartitioner.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/MultiResourcePartitioner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
* {@link ExecutionContext} per resource, and labels them as
* {partition0, partition1, ..., partitionN}. The grid size is
* ignored.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -65,10 +65,10 @@ public class MultiResourcePartitioner implements Partitioner {
/**
* Assign the filename of each of the injected resources to an
* {@link ExecutionContext}.
- *
+ *
* @see Partitioner#partition(int)
*/
- @Override
+ @Override
public Map partition(int gridSize) {
Map map = new HashMap(gridSize);
int i = 0;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionStep.java
index 04ddf492f..6eed9e759 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionStep.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/PartitionStep.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import org.springframework.util.Assert;
/**
* Implementation of {@link Step} which partitions the execution and spreads the
* load using a {@link PartitionHandler}.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -46,7 +46,7 @@ public class PartitionStep extends AbstractStep {
/**
* A {@link PartitionHandler} which can send out step executions for remote
* processing and bring back the results.
- *
+ *
* @param partitionHandler the {@link PartitionHandler} to set
*/
public void setPartitionHandler(PartitionHandler partitionHandler) {
@@ -57,7 +57,7 @@ public class PartitionStep extends AbstractStep {
* A {@link StepExecutionAggregator} that can aggregate step executions when
* they come back from the handler. Defaults to a
* {@link DefaultStepExecutionAggregator}.
- *
+ *
* @param stepExecutionAggregator the {@link StepExecutionAggregator} to set
*/
public void setStepExecutionAggregator(StepExecutionAggregator stepExecutionAggregator) {
@@ -75,10 +75,10 @@ public class PartitionStep extends AbstractStep {
/**
* Assert that mandatory properties are set (stepExecutionSplitter,
* partitionHandler) and delegate top superclass.
- *
+ *
* @see AbstractStep#afterPropertiesSet()
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(stepExecutionSplitter, "StepExecutionSplitter must be provided");
Assert.notNull(partitionHandler, "PartitionHandler must be provided");
@@ -93,9 +93,9 @@ public class PartitionStep extends AbstractStep {
* individual step executions and their input parameters (through
* {@link ExecutionContext}) for the partition elements are provided by the
* {@link StepExecutionSplitter}.
- *
+ *
* @param stepExecution the master step execution for the partition
- *
+ *
* @see Step#execute(StepExecution)
*/
@Override
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregator.java
index cff7d490d..f49ddf4f5 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregator.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/RemoteStepExecutionAggregator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
* Convenience class for aggregating a set of {@link StepExecution} instances
* when the input comes from remote steps, so the data need to be refreshed from
* the repository.
- *
+ *
* @author Dave Syer
* @since 2.1
*/
@@ -47,7 +47,7 @@ public class RemoteStepExecutionAggregator implements StepExecutionAggregator, I
/**
* Create a new instance with a job explorer that can be used to refresh the
* data when aggregating.
- *
+ *
* @param jobExplorer the {@link JobExplorer} to use
*/
public RemoteStepExecutionAggregator(JobExplorer jobExplorer) {
@@ -72,7 +72,7 @@ public class RemoteStepExecutionAggregator implements StepExecutionAggregator, I
/**
* @throws Exception if the job explorer is not provided
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.state(jobExplorer != null, "A JobExplorer must be provided");
}
@@ -81,10 +81,10 @@ public class RemoteStepExecutionAggregator implements StepExecutionAggregator, I
* Aggregates the input executions into the result {@link StepExecution}
* delegating to the delegate aggregator once the input has been refreshed
* from the {@link JobExplorer}.
- *
+ *
* @see StepExecutionAggregator #aggregate(StepExecution, Collection)
*/
- @Override
+ @Override
public void aggregate(StepExecution result, Collection executions) {
Assert.notNull(result, "To aggregate into a result it must be non-null.");
if (executions == null) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimplePartitioner.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimplePartitioner.java
index dbcd46359..7b9c3848e 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimplePartitioner.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimplePartitioner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import org.springframework.batch.item.ExecutionContext;
* of empty {@link ExecutionContext} instances, and labels them as
* {partition0, partition1, ..., partitionN}, where N is the grid
* size.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -34,7 +34,7 @@ public class SimplePartitioner implements Partitioner {
private static final String PARTITION_KEY = "partition";
- @Override
+ @Override
public Map partition(int gridSize) {
Map map = new HashMap(gridSize);
for (int i = 0; i < gridSize; i++) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java
index 4967a2445..a6db0a6b8 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/SimpleStepExecutionSplitter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,8 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
@@ -44,7 +44,7 @@ import org.springframework.util.Assert;
* base (name of the target step) plus a suffix taken from the
* {@link Partitioner} identifiers, separated by a colon, e.g.
* {step1:partition0, step1:partition1, ...}.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -69,7 +69,7 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
/**
* Construct a {@link SimpleStepExecutionSplitter} from its mandatory
* properties.
- *
+ *
* @param jobRepository the {@link JobRepository}
* @param allowStartIfComplete flag specifying preferences on restart
* @param stepName the target step name
@@ -86,13 +86,13 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
/**
* Construct a {@link SimpleStepExecutionSplitter} from its mandatory
* properties.
- *
+ *
* @param jobRepository the {@link JobRepository}
* @param step the target step (a local version of it), used to extract the
* name and allowStartIfComplete flags
* @param partitioner a {@link Partitioner} to use for generating input
* parameters
- *
+ *
* @deprecated use {@link #SimpleStepExecutionSplitter(JobRepository, boolean, String, Partitioner)} instead
*/
@Deprecated
@@ -105,10 +105,10 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
/**
* Check mandatory properties (step name, job repository and partitioner).
- *
+ *
* @see InitializingBean#afterPropertiesSet()
*/
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.state(jobRepository != null, "A JobRepository is required");
Assert.state(stepName != null, "A step name is required");
@@ -119,9 +119,9 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
* Flag to indicate that the partition target step is allowed to start if an
* execution is complete. Defaults to the same value as the underlying step.
* Set this manually to override the underlying step properties.
- *
+ *
* @see Step#isAllowStartIfComplete()
- *
+ *
* @param allowStartIfComplete the value to set
*/
public void setAllowStartIfComplete(boolean allowStartIfComplete) {
@@ -131,7 +131,7 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
/**
* The job repository that will be used to manage the persistence of the
* delegate step executions.
- *
+ *
* @param jobRepository the JobRepository to set
*/
public void setJobRepository(JobRepository jobRepository) {
@@ -141,7 +141,7 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
/**
* The {@link Partitioner} that will be used to generate step execution meta
* data for the target step.
- *
+ *
* @param partitioner the partitioner to set
*/
public void setPartitioner(Partitioner partitioner) {
@@ -151,7 +151,7 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
/**
* The name of the target step that will be executed across the partitions.
* Mandatory with no default.
- *
+ *
* @param stepName the step name to set
*/
public void setStepName(String stepName) {
@@ -161,7 +161,7 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
/**
* @see StepExecutionSplitter#getStepName()
*/
- @Override
+ @Override
public String getStepName() {
return this.stepName;
}
@@ -169,7 +169,7 @@ public class SimpleStepExecutionSplitter implements StepExecutionSplitter, Initi
/**
* @see StepExecutionSplitter#split(StepExecution, int)
*/
- @Override
+ @Override
public Set split(StepExecution stepExecution, int gridSize) throws JobExecutionException {
JobExecution jobExecution = stepExecution.getJobExecution();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java
index f382c3864..083274862 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2012 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,17 +71,17 @@ public class TaskExecutorPartitionHandler extends AbstractPartitionHandler imple
* {@link StepExecution}. This is a regular Spring Batch step, with all the
* business logic required to complete an execution based on the input
* parameters in its {@link StepExecution} context.
- *
+ *
* @param step the {@link Step} instance to use to execute business logic
*/
@Required
public void setStep(Step step) {
this.step = step;
}
-
+
/**
* The step instance that will be executed in parallel by this handler.
- *
+ *
* @return the step instance that will be used
* @see StepHolder#getStep()
*/
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/AbstractJdbcBatchMetadataDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/AbstractJdbcBatchMetadataDao.java
index 1c648ba06..a6e393686 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/AbstractJdbcBatchMetadataDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/AbstractJdbcBatchMetadataDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import org.springframework.util.StringUtils;
/**
* Encapsulates common functionality needed by JDBC batch metadata DAOs -
* provides jdbcTemplate for subclasses and handles table prefixes.
- *
+ *
* @author Robert Kasanicky
*/
public abstract class AbstractJdbcBatchMetadataDao implements InitializingBean {
@@ -35,11 +35,11 @@ public abstract class AbstractJdbcBatchMetadataDao implements InitializingBean {
* Default value for the table prefix property.
*/
public static final String DEFAULT_TABLE_PREFIX = "BATCH_";
-
+
public static final int DEFAULT_EXIT_MESSAGE_LENGTH = 2500;
private String tablePrefix = DEFAULT_TABLE_PREFIX;
-
+
private int clobTypeToUse = Types.CLOB;
private JdbcOperations jdbcTemplate;
@@ -47,7 +47,7 @@ public abstract class AbstractJdbcBatchMetadataDao implements InitializingBean {
protected String getQuery(String base) {
return StringUtils.replace(base, "%PREFIX%", tablePrefix);
}
-
+
protected String getTablePrefix() {
return tablePrefix;
}
@@ -56,7 +56,7 @@ public abstract class AbstractJdbcBatchMetadataDao implements InitializingBean {
* Public setter for the table prefix property. This will be prefixed to all
* the table names before queries are executed. Defaults to
* {@link #DEFAULT_TABLE_PREFIX}.
- *
+ *
* @param tablePrefix the tablePrefix to set
*/
public void setTablePrefix(String tablePrefix) {
@@ -70,7 +70,7 @@ public abstract class AbstractJdbcBatchMetadataDao implements InitializingBean {
protected JdbcOperations getJdbcTemplate() {
return jdbcTemplate;
}
-
+
public int getClobTypeToUse() {
return clobTypeToUse;
}
@@ -79,7 +79,7 @@ public abstract class AbstractJdbcBatchMetadataDao implements InitializingBean {
this.clobTypeToUse = clobTypeToUse;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(jdbcTemplate);
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/DefaultExecutionContextSerializer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/DefaultExecutionContextSerializer.java
index 3533613e6..93323eb8a 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/DefaultExecutionContextSerializer.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/DefaultExecutionContextSerializer.java
@@ -1,5 +1,17 @@
-/**
+/*
+ * Copyright 2012-2013 the original author or authors.
*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package org.springframework.batch.core.repository.dao;
@@ -22,6 +34,7 @@ import org.springframework.util.Assert;
* @author Michael Minella
* @since 2.2
*/
+@SuppressWarnings("rawtypes")
public class DefaultExecutionContextSerializer implements ExecutionContextSerializer {
private Serializer serializer = new DefaultSerializer();
@@ -34,7 +47,7 @@ public class DefaultExecutionContextSerializer implements ExecutionContextSerial
* @param context
* @param out
*/
- @Override
+ @Override
@SuppressWarnings("unchecked")
public void serialize(Object context, OutputStream out) throws IOException {
Assert.notNull(context);
@@ -49,7 +62,7 @@ public class DefaultExecutionContextSerializer implements ExecutionContextSerial
* @param inputStream
* @return the object serialized in the provided {@link InputStream}
*/
- @Override
+ @Override
public Object deserialize(InputStream inputStream) throws IOException {
return deserializer.deserialize(inputStream);
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java
index 0b09db54f..e6222595b 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -100,7 +100,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
this.shortContextLength = shortContextLength;
}
- @Override
+ @Override
public ExecutionContext getExecutionContext(JobExecution jobExecution) {
Long executionId = jobExecution.getId();
Assert.notNull(executionId, "ExecutionId must not be null.");
@@ -115,7 +115,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
}
}
- @Override
+ @Override
public ExecutionContext getExecutionContext(StepExecution stepExecution) {
Long executionId = stepExecution.getId();
Assert.notNull(executionId, "ExecutionId must not be null.");
@@ -130,7 +130,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
}
}
- @Override
+ @Override
public void updateExecutionContext(final JobExecution jobExecution) {
Long executionId = jobExecution.getId();
ExecutionContext executionContext = jobExecution.getExecutionContext();
@@ -142,7 +142,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
persistSerializedContext(executionId, serializedContext, UPDATE_JOB_EXECUTION_CONTEXT);
}
- @Override
+ @Override
public void updateExecutionContext(final StepExecution stepExecution) {
Long executionId = stepExecution.getId();
@@ -155,7 +155,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
persistSerializedContext(executionId, serializedContext, UPDATE_STEP_EXECUTION_CONTEXT);
}
- @Override
+ @Override
public void saveExecutionContext(JobExecution jobExecution) {
Long executionId = jobExecution.getId();
@@ -168,7 +168,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
persistSerializedContext(executionId, serializedContext, INSERT_JOB_EXECUTION_CONTEXT);
}
- @Override
+ @Override
public void saveExecutionContext(StepExecution stepExecution) {
Long executionId = stepExecution.getId();
ExecutionContext executionContext = stepExecution.getExecutionContext();
@@ -210,7 +210,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
}
getJdbcTemplate().update(getQuery(sql), new PreparedStatementSetter() {
- @Override
+ @Override
public void setValues(PreparedStatement ps) throws SQLException {
ps.setString(1, shortContext);
if (longContext != null) {
@@ -224,6 +224,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
});
}
+ @SuppressWarnings("unchecked")
private String serializeContext(ExecutionContext ctx) {
Map m = new HashMap();
for (Entry me : ctx.entrySet()) {
@@ -247,7 +248,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
@SuppressWarnings("unchecked")
private class ExecutionContextRowMapper implements ParameterizedRowMapper {
- @Override
+ @Override
public ExecutionContext mapRow(ResultSet rs, int i) throws SQLException {
ExecutionContext executionContext = new ExecutionContext();
String serializedContext = rs.getString("SERIALIZED_CONTEXT");
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java
index cf9c7b21c..83bf252c7 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2012 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,14 +38,14 @@ import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer
import org.springframework.util.Assert;
/**
- * Jdbc implementation of {@link JobExecutionDao}. Uses sequences (via Spring's
+ * JDBC implementation of {@link JobExecutionDao}. Uses sequences (via Spring's
* {@link DataFieldMaxValueIncrementer} abstraction) to create all primary keys
* before inserting a new row. Objects are checked to ensure all mandatory
* fields to be stored are not null. If any are found to be null, an
* IllegalArgumentException will be thrown. This could be left to JdbcTemplate,
* however, the exception will be fairly vague, and fails to highlight which
* field caused the exception.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
* @author Robert Kasanicky
@@ -95,20 +95,20 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
/**
* Setter for {@link DataFieldMaxValueIncrementer} to be used when
* generating primary keys for {@link JobExecution} instances.
- *
+ *
* @param jobExecutionIncrementer the {@link DataFieldMaxValueIncrementer}
*/
public void setJobExecutionIncrementer(DataFieldMaxValueIncrementer jobExecutionIncrementer) {
this.jobExecutionIncrementer = jobExecutionIncrementer;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notNull(jobExecutionIncrementer, "The jobExecutionIncrementer must not be null.");
}
- @Override
+ @Override
public List findJobExecutions(final JobInstance job) {
Assert.notNull(job, "Job cannot be null.");
@@ -118,16 +118,16 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
}
/**
- *
+ *
* SQL implementation using Sequences via the Spring incrementer
* abstraction. Once a new id has been obtained, the JobExecution is saved
* via a SQL INSERT statement.
- *
+ *
* @see JobExecutionDao#saveJobExecution(JobExecution)
* @throws IllegalArgumentException if jobExecution is null, as well as any
* of it's fields to be persisted.
*/
- @Override
+ @Override
public void saveJobExecution(JobExecution jobExecution) {
validateJobExecution(jobExecution);
@@ -143,13 +143,13 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
getQuery(SAVE_JOB_EXECUTION),
parameters,
new int[] { Types.BIGINT, Types.BIGINT, Types.TIMESTAMP, Types.TIMESTAMP, Types.VARCHAR,
- Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.TIMESTAMP, Types.TIMESTAMP });
+ Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.TIMESTAMP, Types.TIMESTAMP });
}
/**
* Validate JobExecution. At a minimum, JobId, StartTime, EndTime, and
* Status cannot be null.
- *
+ *
* @param jobExecution
* @throws IllegalArgumentException
*/
@@ -166,10 +166,10 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
* is first checked to ensure all fields are not null, and that it has an
* ID. The database is then queried to ensure that the ID exists, which
* ensures that it is valid.
- *
+ *
* @see JobExecutionDao#updateJobExecution(JobExecution)
*/
- @Override
+ @Override
public void updateJobExecution(JobExecution jobExecution) {
validateJobExecution(jobExecution);
@@ -206,7 +206,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
getQuery(UPDATE_JOB_EXECUTION),
parameters,
new int[] { Types.TIMESTAMP, Types.TIMESTAMP, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
- Types.INTEGER, Types.TIMESTAMP, Types.TIMESTAMP, Types.BIGINT, Types.INTEGER });
+ Types.INTEGER, Types.TIMESTAMP, Types.TIMESTAMP, Types.BIGINT, Types.INTEGER });
// Avoid concurrent modifications...
if (count == 0) {
@@ -221,7 +221,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
}
}
- @Override
+ @Override
public JobExecution getLastJobExecution(JobInstance jobInstance) {
Long id = jobInstance.getId();
@@ -241,11 +241,11 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
/*
* (non-Javadoc)
- *
+ *
* @seeorg.springframework.batch.core.repository.dao.JobExecutionDao#
* getLastJobExecution(java.lang.String)
*/
- @Override
+ @Override
public JobExecution getJobExecution(Long executionId) {
try {
JobExecution jobExecution = getJdbcTemplate().queryForObject(getQuery(GET_EXECUTION_BY_ID),
@@ -259,16 +259,16 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
/*
* (non-Javadoc)
- *
+ *
* @seeorg.springframework.batch.core.repository.dao.JobExecutionDao#
* findRunningJobExecutions(java.lang.String)
*/
- @Override
+ @Override
public Set findRunningJobExecutions(String jobName) {
final Set result = new HashSet();
RowCallbackHandler handler = new RowCallbackHandler() {
- @Override
+ @Override
public void processRow(ResultSet rs) throws SQLException {
JobExecutionRowMapper mapper = new JobExecutionRowMapper();
result.add(mapper.mapRow(rs, 0));
@@ -279,7 +279,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
return result;
}
- @Override
+ @Override
public void synchronizeStatus(JobExecution jobExecution) {
int currentVersion = getJdbcTemplate().queryForInt(getQuery(CURRENT_VERSION_JOB_EXECUTION),
jobExecution.getId());
@@ -293,9 +293,9 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
/**
* Re-usable mapper for {@link JobExecution} instances.
- *
+ *
* @author Dave Syer
- *
+ *
*/
private static class JobExecutionRowMapper implements ParameterizedRowMapper {
@@ -308,7 +308,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
this.jobInstance = jobInstance;
}
- @Override
+ @Override
public JobExecution mapRow(ResultSet rs, int rowNum) throws SQLException {
Long id = rs.getLong(1);
JobExecution jobExecution;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java
index f5c11f01c..6bd2f6f9f 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,8 +34,8 @@ import java.util.Map.Entry;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobParameter;
-import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParameter.ParameterType;
+import org.springframework.batch.core.JobParameters;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
@@ -47,20 +47,20 @@ import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
- * Jdbc implementation of {@link JobInstanceDao}. Uses sequences (via Spring's
+ * JDBC implementation of {@link JobInstanceDao}. Uses sequences (via Spring's
* {@link DataFieldMaxValueIncrementer} abstraction) to create all primary keys
* before inserting a new row. Objects are checked to ensure all mandatory
* fields to be stored are not null. If any are found to be null, an
* IllegalArgumentException will be thrown. This could be left to JdbcTemplate,
* however, the exception will be fairly vague, and fails to highlight which
* field caused the exception.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
* @author Robert Kasanicky
*/
public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
- JobInstanceDao, InitializingBean {
+JobInstanceDao, InitializingBean {
private static final String CREATE_JOB_INSTANCE = "INSERT into %PREFIX%JOB_INSTANCE(JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, VERSION)"
+ " values (?, ?, ?, ?)";
@@ -93,12 +93,12 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
* In this jdbc implementation a job id is obtained by asking the
* jobIncrementer (which is likely a sequence) for the next long value, and
* then passing the Id and parameter values into an INSERT statement.
- *
+ *
* @see JobInstanceDao#createJobInstance(String, JobParameters)
* @throws IllegalArgumentException
* if any {@link JobParameters} fields are null.
*/
- @Override
+ @Override
public JobInstance createJobInstance(String jobName,
JobParameters jobParameters) {
@@ -119,7 +119,7 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
getQuery(CREATE_JOB_INSTANCE),
parameters,
new int[] { Types.BIGINT, Types.VARCHAR, Types.VARCHAR,
- Types.INTEGER });
+ Types.INTEGER });
insertJobParameters(jobId, jobParameters);
@@ -159,7 +159,7 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
/**
* Convenience method that inserts all parameters from the provided
* JobParameters.
- *
+ *
*/
private void insertJobParameters(Long jobId, JobParameters jobParameters) {
@@ -202,12 +202,12 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
/**
* The job table is queried for any jobs that match the
* given identifier, adding them to a list via the RowMapper callback.
- *
+ *
* @see JobInstanceDao#getJobInstance(String, JobParameters)
* @throws IllegalArgumentException
* if any {@link JobParameters} fields are null.
*/
- @Override
+ @Override
public JobInstance getJobInstance(final String jobName,
final JobParameters jobParameters) {
@@ -239,12 +239,12 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.repository.dao.JobInstanceDao#getJobInstance
* (java.lang.Long)
*/
- @Override
+ @Override
public JobInstance getJobInstance(Long instanceId) {
try {
@@ -263,7 +263,7 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
private JobParameters getJobParameters(Long instanceId) {
final Map map = new HashMap();
RowCallbackHandler handler = new RowCallbackHandler() {
- @Override
+ @Override
public void processRow(ResultSet rs) throws SQLException {
ParameterType type = ParameterType.valueOf(rs.getString(3));
JobParameter value = null;
@@ -286,30 +286,31 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.repository.dao.JobInstanceDao#getJobNames
* ()
*/
- @Override
+ @Override
public List getJobNames() {
return getJdbcTemplate().query(getQuery(FIND_JOB_NAMES),
new ParameterizedRowMapper() {
- @Override
- public String mapRow(ResultSet rs, int rowNum)
- throws SQLException {
- return rs.getString(1);
- }
- });
+ @Override
+ public String mapRow(ResultSet rs, int rowNum)
+ throws SQLException {
+ return rs.getString(1);
+ }
+ });
}
/*
* (non-Javadoc)
- *
+ *
* @seeorg.springframework.batch.core.repository.dao.JobInstanceDao#
* getLastJobInstances(java.lang.String, int)
*/
- @Override
+ @Override
+ @SuppressWarnings("rawtypes")
public List getJobInstances(String jobName, final int start,
final int count) {
@@ -317,9 +318,9 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
private List list = new ArrayList();
- @Override
+ @Override
public Object extractData(ResultSet rs) throws SQLException,
- DataAccessException {
+ DataAccessException {
int rowNum = 0;
while (rowNum < start && rs.next()) {
rowNum++;
@@ -336,19 +337,19 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
@SuppressWarnings("unchecked")
List result = (List) getJdbcTemplate().query(getQuery(FIND_LAST_JOBS_BY_NAME),
- new Object[] { jobName }, extractor);
+ new Object[] { jobName }, extractor);
return result;
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.repository.dao.JobInstanceDao#getJobInstance
* (org.springframework.batch.core.JobExecution)
*/
- @Override
+ @Override
public JobInstance getJobInstance(JobExecution jobExecution) {
try {
@@ -363,7 +364,7 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
/**
* Setter for {@link DataFieldMaxValueIncrementer} to be used when
* generating primary keys for {@link JobInstance} instances.
- *
+ *
* @param jobIncrementer
* the {@link DataFieldMaxValueIncrementer}
*/
@@ -371,7 +372,7 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
this.jobIncrementer = jobIncrementer;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notNull(jobIncrementer);
@@ -379,10 +380,10 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
/**
* @author Dave Syer
- *
+ *
*/
private final class JobInstanceRowMapper implements
- ParameterizedRowMapper {
+ ParameterizedRowMapper {
private JobParameters jobParameters;
@@ -393,7 +394,7 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements
this.jobParameters = jobParameters;
}
- @Override
+ @Override
public JobInstance mapRow(ResultSet rs, int rowNum) throws SQLException {
Long id = rs.getLong(1);
if (jobParameters == null) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java
index dc014a923..6a570c566 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,22 +34,22 @@ import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer
import org.springframework.util.Assert;
/**
- * Jdbc implementation of {@link StepExecutionDao}.
- *
+ * JDBC implementation of {@link StepExecutionDao}.
+ *
* Allows customization of the tables names used by Spring Batch for step meta
* data via a prefix property.
- *
+ *
* Uses sequences or tables (via Spring's {@link DataFieldMaxValueIncrementer}
* abstraction) to create all primary keys before inserting a new row. All
* objects are checked to ensure all fields to be stored are not null. If any
* are found to be null, an IllegalArgumentException will be thrown. This could
* be left to JdbcTemplate, however, the exception will be fairly vague, and
* fails to highlight which field caused the exception.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
* @author Robert Kasanicky
- *
+ *
* @see StepExecutionDao
*/
public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implements StepExecutionDao, InitializingBean {
@@ -91,7 +91,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
this.stepExecutionIncrementer = stepExecutionIncrementer;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notNull(stepExecutionIncrementer, "StepExecutionIncrementer cannot be null.");
@@ -101,10 +101,10 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
* Save a StepExecution. A unique id will be generated by the
* stepExecutionIncrementor, and then set in the StepExecution. All values
* will then be stored via an INSERT statement.
- *
+ *
* @see StepExecutionDao#saveStepExecution(StepExecution)
*/
- @Override
+ @Override
public void saveStepExecution(StepExecution stepExecution) {
Assert.isNull(stepExecution.getId(),
@@ -129,15 +129,15 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
getQuery(SAVE_STEP_EXECUTION),
parameters,
new int[] { Types.BIGINT, Types.INTEGER, Types.VARCHAR, Types.BIGINT, Types.TIMESTAMP,
- Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.INTEGER,
- Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.INTEGER,
- Types.TIMESTAMP });
+ Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.INTEGER,
+ Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.INTEGER,
+ Types.TIMESTAMP });
}
/**
* Validate StepExecution. At a minimum, JobId, StartTime, and Status cannot
* be null. EndTime can be null for an unfinished job.
- *
+ *
* @throws IllegalArgumentException
*/
private void validateStepExecution(StepExecution stepExecution) {
@@ -147,7 +147,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
Assert.notNull(stepExecution.getStatus(), "StepExecution status cannot be null.");
}
- @Override
+ @Override
public void updateStepExecution(StepExecution stepExecution) {
validateStepExecution(stepExecution);
@@ -172,12 +172,12 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
stepExecution.getWriteSkipCount(), stepExecution.getRollbackCount(),
stepExecution.getLastUpdated(), stepExecution.getId(), stepExecution.getVersion() };
int count = getJdbcTemplate().update(
- getQuery(UPDATE_STEP_EXECUTION),
- parameters,
- new int[] { Types.TIMESTAMP, Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.INTEGER,
- Types.INTEGER, Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER,
- Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.TIMESTAMP,
- Types.BIGINT, Types.INTEGER });
+ getQuery(UPDATE_STEP_EXECUTION),
+ parameters,
+ new int[] { Types.TIMESTAMP, Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.INTEGER,
+ Types.INTEGER, Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER,
+ Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.TIMESTAMP,
+ Types.BIGINT, Types.INTEGER });
// Avoid concurrent modifications...
if (count == 0) {
@@ -209,7 +209,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
}
}
- @Override
+ @Override
public StepExecution getStepExecution(JobExecution jobExecution, Long stepExecutionId) {
List executions = getJdbcTemplate().query(getQuery(GET_STEP_EXECUTION),
new StepExecutionRowMapper(jobExecution), jobExecution.getId(), stepExecutionId);
@@ -224,7 +224,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
}
}
- @Override
+ @Override
public void addStepExecutions(JobExecution jobExecution) {
getJdbcTemplate().query(getQuery(GET_STEP_EXECUTIONS), new StepExecutionRowMapper(jobExecution),
jobExecution.getId());
@@ -238,7 +238,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
this.jobExecution = jobExecution;
}
- @Override
+ @Override
public StepExecution mapRow(ResultSet rs, int rowNum) throws SQLException {
StepExecution stepExecution = new StepExecution(rs.getString(2), jobExecution, rs.getLong(1));
stepExecution.setStartTime(rs.getTimestamp(3));
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapExecutionContextDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapExecutionContextDao.java
index 8585cce2d..d70dd28aa 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapExecutionContextDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapExecutionContextDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,10 +27,11 @@ import org.springframework.batch.support.transaction.TransactionAwareProxyFactor
/**
* In-memory implementation of {@link ExecutionContextDao} backed by maps.
- *
+ *
* @author Robert Kasanicky
* @author Dave Syer
*/
+@SuppressWarnings("serial")
public class MapExecutionContextDao implements ExecutionContextDao {
private final ConcurrentMap contexts = TransactionAwareProxyFactory
@@ -44,30 +45,44 @@ public class MapExecutionContextDao implements ExecutionContextDao {
private final long id;
private ContextKey(Type type, long id) {
- if(type == null) throw new IllegalStateException("Need a non-null type for a context");
+ if(type == null) {
+ throw new IllegalStateException("Need a non-null type for a context");
+ }
this.type = type;
this.id = id;
}
- @Override
+ @Override
public int compareTo(ContextKey them) {
- if(them == null) return 1;
+ if(them == null) {
+ return 1;
+ }
final int idCompare = new Long(this.id).compareTo(new Long(them.id)); // JDK6 Make this Long.compare(x,y)
- if(idCompare != 0) return idCompare;
+ if(idCompare != 0) {
+ return idCompare;
+ }
final int typeCompare = this.type.compareTo(them.type);
- if(typeCompare != 0) return typeCompare;
+ if(typeCompare != 0) {
+ return typeCompare;
+ }
return 0;
}
@Override
public boolean equals(Object them) {
- if(them == null) return false;
- if(them instanceof ContextKey) return this.equals((ContextKey)them);
+ if(them == null) {
+ return false;
+ }
+ if(them instanceof ContextKey) {
+ return this.equals((ContextKey)them);
+ }
return false;
}
public boolean equals(ContextKey them) {
- if(them == null) return false;
+ if(them == null) {
+ return false;
+ }
return this.id == them.id && this.type.equals(them.type);
}
@@ -75,9 +90,9 @@ public class MapExecutionContextDao implements ExecutionContextDao {
public int hashCode() {
int value = (int)(id^(id>>>32));
switch(type) {
- case STEP: return value;
- case JOB: return ~value;
- default: throw new IllegalStateException("Unknown type encountered in switch: " + type);
+ case STEP: return value;
+ case JOB: return ~value;
+ default: throw new IllegalStateException("Unknown type encountered in switch: " + type);
}
}
@@ -86,7 +101,7 @@ public class MapExecutionContextDao implements ExecutionContextDao {
public static ContextKey job(long id) { return new ContextKey(Type.JOB, id); }
}
- public void clear() {
+ public void clear() {
contexts.clear();
}
@@ -94,12 +109,12 @@ public class MapExecutionContextDao implements ExecutionContextDao {
return (ExecutionContext) SerializationUtils.deserialize(SerializationUtils.serialize(original));
}
- @Override
+ @Override
public ExecutionContext getExecutionContext(StepExecution stepExecution) {
return copy(contexts.get(ContextKey.step(stepExecution.getId())));
}
- @Override
+ @Override
public void updateExecutionContext(StepExecution stepExecution) {
ExecutionContext executionContext = stepExecution.getExecutionContext();
if (executionContext != null) {
@@ -107,12 +122,12 @@ public class MapExecutionContextDao implements ExecutionContextDao {
}
}
- @Override
+ @Override
public ExecutionContext getExecutionContext(JobExecution jobExecution) {
return copy(contexts.get(ContextKey.job(jobExecution.getId())));
}
- @Override
+ @Override
public void updateExecutionContext(JobExecution jobExecution) {
ExecutionContext executionContext = jobExecution.getExecutionContext();
if (executionContext != null) {
@@ -120,12 +135,12 @@ public class MapExecutionContextDao implements ExecutionContextDao {
}
}
- @Override
+ @Override
public void saveExecutionContext(JobExecution jobExecution) {
updateExecutionContext(jobExecution);
}
- @Override
+ @Override
public void saveExecutionContext(StepExecution stepExecution) {
updateExecutionContext(stepExecution);
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobExecutionDao.java
index d50302061..7c30b8ac2 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobExecutionDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobExecutionDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,10 +22,8 @@ import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-
import java.util.concurrent.atomic.AtomicLong;
import org.springframework.batch.core.JobExecution;
@@ -53,7 +51,7 @@ public class MapJobExecutionDao implements JobExecutionDao {
return copy;
}
- @Override
+ @Override
public void saveJobExecution(JobExecution jobExecution) {
Assert.isTrue(jobExecution.getId() == null);
Long newId = currentId.getAndIncrement();
@@ -62,7 +60,7 @@ public class MapJobExecutionDao implements JobExecutionDao {
executionsById.put(newId, copy(jobExecution));
}
- @Override
+ @Override
public List findJobExecutions(JobInstance jobInstance) {
List executions = new ArrayList();
for (JobExecution exec : executionsById.values()) {
@@ -72,7 +70,7 @@ public class MapJobExecutionDao implements JobExecutionDao {
}
Collections.sort(executions, new Comparator() {
- @Override
+ @Override
public int compare(JobExecution e1, JobExecution e2) {
long result = (e1.getId() - e2.getId());
if (result > 0) {
@@ -89,7 +87,7 @@ public class MapJobExecutionDao implements JobExecutionDao {
return executions;
}
- @Override
+ @Override
public void updateJobExecution(JobExecution jobExecution) {
Long id = jobExecution.getId();
Assert.notNull(id, "JobExecution is expected to have an id (should be saved already)");
@@ -107,7 +105,7 @@ public class MapJobExecutionDao implements JobExecutionDao {
}
}
- @Override
+ @Override
public JobExecution getLastJobExecution(JobInstance jobInstance) {
JobExecution lastExec = null;
for (JobExecution exec : executionsById.values()) {
@@ -126,11 +124,11 @@ public class MapJobExecutionDao implements JobExecutionDao {
/*
* (non-Javadoc)
- *
+ *
* @seeorg.springframework.batch.core.repository.dao.JobExecutionDao#
* findRunningJobExecutions(java.lang.String)
*/
- @Override
+ @Override
public Set findRunningJobExecutions(String jobName) {
Set result = new HashSet();
for (JobExecution exec : executionsById.values()) {
@@ -144,17 +142,17 @@ public class MapJobExecutionDao implements JobExecutionDao {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.batch.core.repository.dao.JobExecutionDao#getJobExecution
* (java.lang.Long)
*/
- @Override
+ @Override
public JobExecution getJobExecution(Long executionId) {
return copy(executionsById.get(executionId));
}
- @Override
+ @Override
public void synchronizeStatus(JobExecution jobExecution) {
JobExecution saved = getJobExecution(jobExecution.getId());
if (saved.getVersion().intValue() != jobExecution.getVersion().intValue()) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobInstanceDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobInstanceDao.java
index 7c6b2da9c..a0e23c953 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobInstanceDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapJobInstanceDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,9 +21,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
-
import java.util.concurrent.CopyOnWriteArraySet;
-
import java.util.concurrent.atomic.AtomicLong;
import org.springframework.batch.core.JobExecution;
@@ -45,7 +43,7 @@ public class MapJobInstanceDao implements JobInstanceDao {
jobInstances.clear();
}
- @Override
+ @Override
public JobInstance createJobInstance(String jobName, JobParameters jobParameters) {
Assert.state(getJobInstance(jobName, jobParameters) == null, "JobInstance must not already exist");
@@ -57,7 +55,7 @@ public class MapJobInstanceDao implements JobInstanceDao {
return jobInstance;
}
- @Override
+ @Override
public JobInstance getJobInstance(String jobName, JobParameters jobParameters) {
for (JobInstance instance : jobInstances) {
@@ -69,7 +67,7 @@ public class MapJobInstanceDao implements JobInstanceDao {
}
- @Override
+ @Override
public JobInstance getJobInstance(Long instanceId) {
for (JobInstance instance : jobInstances) {
if (instance.getId().equals(instanceId)) {
@@ -79,7 +77,7 @@ public class MapJobInstanceDao implements JobInstanceDao {
return null;
}
- @Override
+ @Override
public List getJobNames() {
List result = new ArrayList();
for (JobInstance instance : jobInstances) {
@@ -89,7 +87,7 @@ public class MapJobInstanceDao implements JobInstanceDao {
return result;
}
- @Override
+ @Override
public List getJobInstances(String jobName, int start, int count) {
List result = new ArrayList();
for (JobInstance instance : jobInstances) {
@@ -99,7 +97,7 @@ public class MapJobInstanceDao implements JobInstanceDao {
}
Collections.sort(result, new Comparator() {
// sort by ID descending
- @Override
+ @Override
public int compare(JobInstance o1, JobInstance o2) {
return Long.signum(o2.getId() - o1.getId());
}
@@ -110,7 +108,7 @@ public class MapJobInstanceDao implements JobInstanceDao {
return result.subList(startIndex, endIndex);
}
- @Override
+ @Override
public JobInstance getJobInstance(JobExecution jobExecution) {
return jobExecution.getJobInstance();
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapStepExecutionDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapStepExecutionDao.java
index e7e8e4095..8a4d62146 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapStepExecutionDao.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MapStepExecutionDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@ public class MapStepExecutionDao implements StepExecutionDao {
// Cheaper than full serialization is a reflective field copy, which is
// fine for volatile storage
ReflectionUtils.doWithFields(StepExecution.class, new ReflectionUtils.FieldCallback() {
- @Override
+ @Override
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
field.setAccessible(true);
field.set(targetExecution, field.get(sourceExecution));
@@ -64,7 +64,7 @@ public class MapStepExecutionDao implements StepExecutionDao {
});
}
- @Override
+ @Override
public void saveStepExecution(StepExecution stepExecution) {
Assert.isTrue(stepExecution.getId() == null);
@@ -85,7 +85,7 @@ public class MapStepExecutionDao implements StepExecutionDao {
}
- @Override
+ @Override
public void updateStepExecution(StepExecution stepExecution) {
Assert.notNull(stepExecution.getJobExecutionId());
@@ -111,12 +111,12 @@ public class MapStepExecutionDao implements StepExecutionDao {
}
}
- @Override
+ @Override
public StepExecution getStepExecution(JobExecution jobExecution, Long stepExecutionId) {
return executionsByStepExecutionId.get(stepExecutionId);
}
- @Override
+ @Override
public void addStepExecutions(JobExecution jobExecution) {
Map executions = executionsByJobExecutionId.get(jobExecution.getId());
if (executions == null || executions.isEmpty()) {
@@ -125,7 +125,7 @@ public class MapStepExecutionDao implements StepExecutionDao {
List result = new ArrayList(executions.values());
Collections.sort(result, new Comparator() {
- @Override
+ @Override
public int compare(Entity o1, Entity o2) {
return Long.signum(o2.getId() - o1.getId());
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/XStreamExecutionContextStringSerializer.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/XStreamExecutionContextStringSerializer.java
index 951b6f8c5..4f050ebb6 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/XStreamExecutionContextStringSerializer.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/XStreamExecutionContextStringSerializer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ public class XStreamExecutionContextStringSerializer implements ExecutionContext
this.hierarchicalStreamDriver = hierarchicalStreamDriver;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
init();
}
@@ -81,7 +81,7 @@ public class XStreamExecutionContextStringSerializer implements ExecutionContext
* @param out
* @see Serializer#serialize(Object, OutputStream)
*/
- @Override
+ @Override
public void serialize(Object context, OutputStream out) throws IOException {
Assert.notNull(context);
Assert.notNull(out);
@@ -96,8 +96,7 @@ public class XStreamExecutionContextStringSerializer implements ExecutionContext
* @return a reconstructed execution context
* @see Deserializer#deserialize(InputStream)
*/
- @Override
- @SuppressWarnings("unchecked")
+ @Override
public Object deserialize(InputStream in) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(in));
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/AbstractJobRepositoryFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/AbstractJobRepositoryFactoryBean.java
index dbfdcaf77..f6a10fb11 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/AbstractJobRepositoryFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/AbstractJobRepositoryFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,14 +38,15 @@ import org.springframework.util.Assert;
* A {@link FactoryBean} that automates the creation of a
* {@link SimpleJobRepository}. Declares abstract methods for providing DAO
* object implementations.
- *
+ *
* @see JobRepositoryFactoryBean
* @see MapJobRepositoryFactoryBean
- *
+ *
* @author Ben Hale
* @author Lucas Ward
* @author Robert Kasanicky
*/
+@SuppressWarnings("rawtypes")
public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean, InitializingBean {
private PlatformTransactionManager transactionManager;
@@ -83,16 +84,16 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean, I
/**
* The type of object to be returned from {@link #getObject()}.
- *
+ *
* @return JobRepository.class
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
*/
- @Override
+ @Override
public Class getObjectType() {
return JobRepository.class;
}
- @Override
+ @Override
public boolean isSingleton() {
return true;
}
@@ -102,7 +103,7 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean, I
* JobExecution is created. Defaults to true because it is usually a
* mistake, and leads to problems with restartability and also to deadlocks
* in multi-threaded steps.
- *
+ *
* @param validateTransactionState the flag to set
*/
public void setValidateTransactionState(boolean validateTransactionState) {
@@ -114,9 +115,9 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean, I
* job execution entities are initially created. The default is
* ISOLATION_SERIALIZABLE, which prevents accidental concurrent execution of
* the same job (ISOLATION_REPEATABLE_READ would work as well).
- *
+ *
* @param isolationLevelForCreate the isolation level name to set
- *
+ *
* @see SimpleJobRepository#createJobExecution(String,
* org.springframework.batch.core.JobParameters)
*/
@@ -135,7 +136,7 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean, I
/**
* The transaction manager used in this factory. Useful to inject into steps
* and jobs, to ensure that they are using the same instance.
- *
+ *
* @return the transactionManager
*/
public PlatformTransactionManager getTransactionManager() {
@@ -161,7 +162,7 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean, I
+ isolationLevelForCreate + "\n*=PROPAGATION_REQUIRED"));
if (validateTransactionState) {
DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(new MethodInterceptor() {
- @Override
+ @Override
public Object invoke(MethodInvocation invocation) throws Throwable {
if (TransactionSynchronizationManager.isActualTransactionActive()) {
throw new IllegalStateException(
@@ -183,7 +184,7 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean, I
}
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(transactionManager, "TransactionManager must not be null.");
@@ -195,7 +196,7 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean, I
createExecutionContextDao());
}
- @Override
+ @Override
public Object getObject() throws Exception {
if (proxyFactory == null) {
afterPropertiesSet();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java
index 1b8ddfe91..9518bfb6f 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,21 +39,21 @@ import org.springframework.batch.item.ExecutionContext;
import org.springframework.util.Assert;
/**
- *
+ *
*
* Implementation of {@link JobRepository} that stores JobInstances,
* JobExecutions, and StepExecutions using the injected DAOs.
*
- *
+ *
* @author Lucas Ward
* @author Dave Syer
* @author Robert Kasanicky
- *
+ *
* @see JobRepository
* @see JobInstanceDao
* @see JobExecutionDao
* @see StepExecutionDao
- *
+ *
*/
public class SimpleJobRepository implements JobRepository {
@@ -83,12 +83,12 @@ public class SimpleJobRepository implements JobRepository {
this.ecDao = ecDao;
}
- @Override
+ @Override
public boolean isJobInstanceExists(String jobName, JobParameters jobParameters) {
return jobInstanceDao.getJobInstance(jobName, jobParameters) != null;
}
- @Override
+ @Override
public JobExecution createJobExecution(String jobName, JobParameters jobParameters)
throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException {
@@ -97,7 +97,7 @@ public class SimpleJobRepository implements JobRepository {
/*
* Find all jobs matching the runtime information.
- *
+ *
* If this method is transactional, and the isolation level is
* REPEATABLE_READ or better, another launcher trying to start the same
* job in another thread or process will block until this transaction
@@ -118,12 +118,12 @@ public class SimpleJobRepository implements JobRepository {
throw new JobExecutionAlreadyRunningException("A job execution for this job is already running: "
+ jobInstance);
}
-
+
BatchStatus status = execution.getStatus();
if (status == BatchStatus.COMPLETED || status == BatchStatus.ABANDONED) {
throw new JobInstanceAlreadyCompleteException(
"A job instance already exists and is complete for parameters=" + jobParameters
- + ". If you want to run this job again, change the parameters.");
+ + ". If you want to run this job again, change the parameters.");
}
}
executionContext = ecDao.getExecutionContext(jobExecutionDao.getLastJobExecution(jobInstance));
@@ -147,7 +147,7 @@ public class SimpleJobRepository implements JobRepository {
}
- @Override
+ @Override
public void update(JobExecution jobExecution) {
Assert.notNull(jobExecution, "JobExecution cannot be null.");
@@ -158,7 +158,7 @@ public class SimpleJobRepository implements JobRepository {
jobExecutionDao.updateJobExecution(jobExecution);
}
- @Override
+ @Override
public void add(StepExecution stepExecution) {
validateStepExecution(stepExecution);
@@ -167,7 +167,7 @@ public class SimpleJobRepository implements JobRepository {
ecDao.saveExecutionContext(stepExecution);
}
- @Override
+ @Override
public void update(StepExecution stepExecution) {
validateStepExecution(stepExecution);
Assert.notNull(stepExecution.getId(), "StepExecution must already be saved (have an id assigned)");
@@ -183,19 +183,19 @@ public class SimpleJobRepository implements JobRepository {
Assert.notNull(stepExecution.getJobExecutionId(), "StepExecution must belong to persisted JobExecution");
}
- @Override
+ @Override
public void updateExecutionContext(StepExecution stepExecution) {
validateStepExecution(stepExecution);
Assert.notNull(stepExecution.getId(), "StepExecution must already be saved (have an id assigned)");
ecDao.updateExecutionContext(stepExecution);
}
-
- @Override
+
+ @Override
public void updateExecutionContext(JobExecution jobExecution) {
ecDao.updateExecutionContext(jobExecution);
}
- @Override
+ @Override
public StepExecution getLastStepExecution(JobInstance jobInstance, String stepName) {
List jobExecutions = jobExecutionDao.findJobExecutions(jobInstance);
List stepExecutions = new ArrayList(jobExecutions.size());
@@ -226,7 +226,7 @@ public class SimpleJobRepository implements JobRepository {
/**
* @return number of executions of the step within given job instance
*/
- @Override
+ @Override
public int getStepExecutionCount(JobInstance jobInstance, String stepName) {
int count = 0;
List jobExecutions = jobExecutionDao.findJobExecutions(jobInstance);
@@ -246,7 +246,7 @@ public class SimpleJobRepository implements JobRepository {
* the provided StepExecution has been interrupted. If, after synchronizing
* the status with the database, the status has been updated to STOPPING,
* then the job has been interrupted.
- *
+ *
* @param stepExecution
*/
private void checkForInterruption(StepExecution stepExecution) {
@@ -258,14 +258,14 @@ public class SimpleJobRepository implements JobRepository {
}
}
- @Override
+ @Override
public JobExecution getLastJobExecution(String jobName, JobParameters jobParameters) {
JobInstance jobInstance = jobInstanceDao.getJobInstance(jobName, jobParameters);
if (jobInstance == null) {
return null;
}
JobExecution jobExecution = jobExecutionDao.getLastJobExecution(jobInstance);
-
+
if (jobExecution != null) {
jobExecution.setExecutionContext(ecDao.getExecutionContext(jobExecution));
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/resource/ListPreparedStatementSetter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/resource/ListPreparedStatementSetter.java
index e8be8af99..8b367bb54 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/resource/ListPreparedStatementSetter.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/resource/ListPreparedStatementSetter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2008 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,21 +29,21 @@ import org.springframework.util.Assert;
/**
* Implementation of the {@link PreparedStatementSetter} interface that accepts
* a list of values to be set on a PreparedStatement. This is usually used in
- * conjunction with the {@link JdbcCursorItemReader} to allow for the replacement
+ * conjunction with the {@link JdbcCursorItemReader} to allow for the replacement
* of bind variables when generating the cursor. The order of the list will be
* used to determine the ordering of setting variables. For example, the first
* item in the list will be the first bind variable set. (i.e. it will
* correspond to the first '?' in the SQL statement)
- *
+ *
* @author Lucas Ward
- *
+ *
*/
public class ListPreparedStatementSetter implements
- PreparedStatementSetter, InitializingBean {
+PreparedStatementSetter, InitializingBean {
private List> parameters;
- @Override
+ @Override
public void setValues(PreparedStatement ps) throws SQLException {
for (int i = 0; i < parameters.size(); i++) {
StatementCreatorUtils.setParameterValue(ps, i + 1, SqlTypeValue.TYPE_UNKNOWN, parameters.get(i));
@@ -59,7 +59,7 @@ public class ListPreparedStatementSetter implements
this.parameters = parameters;
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(parameters, "Parameters must be provided");
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/resource/StepExecutionSimpleCompletionPolicy.java b/spring-batch-core/src/main/java/org/springframework/batch/core/resource/StepExecutionSimpleCompletionPolicy.java
index 391a335ec..a61393888 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/resource/StepExecutionSimpleCompletionPolicy.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/resource/StepExecutionSimpleCompletionPolicy.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,16 +35,16 @@ import org.springframework.util.Assert;
* step. N.B. only after the step has started will the completion policy be
* usable.
*
- *
+ *
*
* It is easier and probably preferable to simply declare the chunk with a
* commit-interval that is a late-binding expression (e.g.
* #{jobParameters['commit.interval']}). That feature is available
* from of Spring Batch 2.1.7.
*
- *
+ *
* @author Dave Syer
- *
+ *
* @see CompletionPolicy
*/
public class StepExecutionSimpleCompletionPolicy extends StepExecutionListenerSupport implements CompletionPolicy {
@@ -68,10 +68,10 @@ public class StepExecutionSimpleCompletionPolicy extends StepExecutionListenerSu
* the {@link JobParameters}. If there is a Long parameter with the given
* key name, the intValue of this parameter is used. If not an exception
* will be thrown.
- *
+ *
* @see org.springframework.batch.core.listener.StepExecutionListenerSupport#beforeStep(org.springframework.batch.core.StepExecution)
*/
- @Override
+ @Override
public void beforeStep(StepExecution stepExecution) {
JobParameters jobParameters = stepExecution.getJobParameters();
Assert.state(jobParameters.getParameters().containsKey(keyName),
@@ -86,7 +86,7 @@ public class StepExecutionSimpleCompletionPolicy extends StepExecutionListenerSu
* indicates completion
* @see CompletionPolicy#isComplete(RepeatContext, RepeatStatus)
*/
- @Override
+ @Override
public boolean isComplete(RepeatContext context, RepeatStatus result) {
Assert.state(delegate != null, "The delegate resource has not been initialised. "
+ "Remember to register this object as a StepListener.");
@@ -98,7 +98,7 @@ public class StepExecutionSimpleCompletionPolicy extends StepExecutionListenerSu
* @return if the commit interval has been reached
* @see org.springframework.batch.repeat.CompletionPolicy#isComplete(org.springframework.batch.repeat.RepeatContext)
*/
- @Override
+ @Override
public boolean isComplete(RepeatContext context) {
Assert.state(delegate != null, "The delegate resource has not been initialised. "
+ "Remember to register this object as a StepListener.");
@@ -110,7 +110,7 @@ public class StepExecutionSimpleCompletionPolicy extends StepExecutionListenerSu
* @return a new {@link RepeatContext}
* @see org.springframework.batch.repeat.CompletionPolicy#start(org.springframework.batch.repeat.RepeatContext)
*/
- @Override
+ @Override
public RepeatContext start(RepeatContext parent) {
Assert.state(delegate != null, "The delegate resource has not been initialised. "
+ "Remember to register this object as a StepListener.");
@@ -121,7 +121,7 @@ public class StepExecutionSimpleCompletionPolicy extends StepExecutionListenerSu
* @param context
* @see org.springframework.batch.repeat.CompletionPolicy#update(org.springframework.batch.repeat.RepeatContext)
*/
- @Override
+ @Override
public void update(RepeatContext context) {
Assert.state(delegate != null, "The delegate resource has not been initialised. "
+ "Remember to register this object as a StepListener.");
@@ -132,7 +132,7 @@ public class StepExecutionSimpleCompletionPolicy extends StepExecutionListenerSu
* Delegates to the wrapped {@link CompletionPolicy} if set, otherwise
* returns the value of {@link #setKeyName(String)}.
*/
- @Override
+ @Override
public String toString() {
return (delegate == null) ? keyName : delegate.toString();
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/StepScope.java b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/StepScope.java
index fb6ba5aeb..f2e45ef8d 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/StepScope.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/StepScope.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,34 +44,34 @@ import org.springframework.util.StringValueResolver;
* step. All objects in this scope are <aop:scoped-proxy/> (no need to
* decorate the bean definitions).
*
- *
+ *
* In addition, support is provided for late binding of references accessible
* from the {@link StepContext} using #{..} placeholders. Using this feature,
* bean properties can be pulled from the step or job execution context and the
* job parameters. E.g.
- *
+ *
*
* <bean id="..." class="..." scope="step">
* <property name="parent" ref="#{stepExecutionContext[helper]}" />
* </bean>
- *
+ *
* <bean id="..." class="..." scope="step">
* <property name="name" value="#{stepExecutionContext['input.name']}" />
* </bean>
- *
+ *
* <bean id="..." class="..." scope="step">
* <property name="name" value="#{jobParameters[input]}" />
* </bean>
- *
+ *
* <bean id="..." class="..." scope="step">
* <property name="name" value="#{jobExecutionContext['input.stem']}.txt" />
* </bean>
*
- *
+ *
* The {@link StepContext} is referenced using standard bean property paths (as
* per {@link BeanWrapper}). The examples above all show the use of the Map
* accessors provided as a convenience for step and job attributes.
- *
+ *
* @author Dave Syer
* @since 2.0
*/
@@ -91,7 +91,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
this.order = order;
}
- @Override
+ @Override
public int getOrder() {
return order;
}
@@ -112,7 +112,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* Flag to indicate that proxies should use dynamic subclassing. This allows
* classes with no interface to be proxied. Defaults to false.
- *
+ *
* @param proxyTargetClass set to true to have proxies created using dynamic
* subclasses
*/
@@ -125,7 +125,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
* step-scoped beans. This method is part of the Scope SPI in Spring 3.0,
* but should just be ignored by earlier versions of Spring.
*/
- @Override
+ @Override
public Object resolveContextualObject(String key) {
StepContext context = getContext();
// TODO: support for attributes as well maybe (setters not exposed yet
@@ -136,7 +136,8 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* @see Scope#get(String, ObjectFactory)
*/
- @Override
+ @SuppressWarnings("rawtypes")
+ @Override
public Object get(String name, ObjectFactory objectFactory) {
StepContext context = getContext();
@@ -164,7 +165,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* @see Scope#getConversationId()
*/
- @Override
+ @Override
public String getConversationId() {
StepContext context = getContext();
return context.getId();
@@ -173,7 +174,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* @see Scope#registerDestructionCallback(String, Runnable)
*/
- @Override
+ @Override
public void registerDestructionCallback(String name, Runnable callback) {
StepContext context = getContext();
logger.debug(String.format("Registered destruction callback in scope=%s, name=%s", this.name, name));
@@ -183,7 +184,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* @see Scope#remove(String)
*/
- @Override
+ @Override
public Object remove(String name) {
StepContext context = getContext();
logger.debug(String.format("Removing from scope=%s, name=%s", this.name, name));
@@ -193,7 +194,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* Get an attribute accessor in the form of a {@link StepContext} that can
* be used to store scoped bean instances.
- *
+ *
* @return the current step context which we can use as a scope storage
* medium
*/
@@ -207,13 +208,13 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* Register this scope with the enclosing BeanFactory.
- *
+ *
* @see BeanFactoryPostProcessor#postProcessBeanFactory(ConfigurableListableBeanFactory)
- *
+ *
* @param beanFactory the BeanFactory to register with
* @throws BeansException if there is a problem.
*/
- @Override
+ @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
beanFactory.registerScope(name, this);
@@ -251,7 +252,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* Public setter for the name property. This can then be used as a bean
* definition attribute, e.g. scope="step". Defaults to "step".
- *
+ *
* @param name the name to set for this scope.
*/
public void setName(String name) {
@@ -264,7 +265,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
* <aop-auto-proxy/> to a step scoped bean. Also if Spring EL is not
* available will enable a weak version of late binding as described in the
* class-level docs.
- *
+ *
* @param beanName the bean name to replace
* @param definition the bean definition to replace
* @param registry the enclosing {@link BeanDefinitionRegistry}
@@ -298,9 +299,9 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* Helper class to scan a bean definition hierarchy and force the use of
* auto-proxy for step scoped beans.
- *
+ *
* @author Dave Syer
- *
+ *
*/
private static class Scopifier extends BeanDefinitionVisitor {
@@ -314,7 +315,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
public Scopifier(BeanDefinitionRegistry registry, String scope, boolean proxyTargetClass, boolean scoped) {
super(new StringValueResolver() {
- @Override
+ @Override
public String resolveStringValue(String value) {
return value;
}
@@ -364,9 +365,9 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
/**
* Helper class to scan a bean definition hierarchy and hide placeholders
* from Spring EL.
- *
+ *
* @author Dave Syer
- *
+ *
*/
private static class ExpressionHider extends BeanDefinitionVisitor {
@@ -382,7 +383,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
private ExpressionHider(String scope, final boolean scoped) {
super(new StringValueResolver() {
- @Override
+ @Override
public String resolveStringValue(String value) {
if (scoped && value.contains(PLACEHOLDER_PREFIX) && value.contains(PLACEHOLDER_SUFFIX)) {
value = value.replace(PLACEHOLDER_PREFIX, REPLACEMENT_PREFIX);
@@ -409,7 +410,7 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
boolean scopeChange = !scope.equals(otherScope);
if (scopeChange) {
new ExpressionHider(otherScope == null ? scope : otherScope, !scoped)
- .visitBeanDefinition(definition);
+ .visitBeanDefinition(definition);
// Exit here so that nested inner bean definitions are not
// analysed by both visitors
return value;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/context/StepContextRepeatCallback.java b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/context/StepContextRepeatCallback.java
index 69e7ea273..b4a383e81 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/context/StepContextRepeatCallback.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/context/StepContextRepeatCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,14 +30,14 @@ import org.springframework.util.ObjectUtils;
/**
* Convenient base class for clients who need to do something in a repeat
* callback inside a {@link Step}.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public abstract class StepContextRepeatCallback implements RepeatCallback {
private final Queue attributeQueue = new LinkedBlockingQueue();
-
+
private final StepExecution stepExecution;
private final Log logger = LogFactory.getLog(StepContextRepeatCallback.class);
@@ -56,12 +56,12 @@ public abstract class StepContextRepeatCallback implements RepeatCallback {
* if the callback is executed in a pooled thread. Handles the registration
* and de-registration of the step context, so clients should not duplicate
* those calls.
- *
+ *
* @see RepeatCallback#doInIteration(RepeatContext)
*/
- @Override
+ @Override
public RepeatStatus doInIteration(RepeatContext context) throws Exception {
-
+
// The StepContext has to be the same for all chunks,
// otherwise step-scoped beans will be re-initialised for each chunk.
StepContext stepContext = StepSynchronizationManager.register(stepExecution);
@@ -95,7 +95,7 @@ public abstract class StepContextRepeatCallback implements RepeatCallback {
* that they are finished with a context by removing all the attributes they
* have added. If a worker does not remove them another thread might see
* stale state.
- *
+ *
* @param context the current {@link RepeatContext}
* @param chunkContext the chunk context in which to carry out the work
* @return the repeat status from the execution
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/util/PlaceholderProxyFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/util/PlaceholderProxyFactoryBean.java
index 4b58e1b43..515469274 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/util/PlaceholderProxyFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/util/PlaceholderProxyFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,10 +41,11 @@ import org.springframework.util.ClassUtils;
* Factory bean for proxies that can replace placeholders in their target. Just
* a specialisation of {@link ScopedProxyFactoryBean}, with a different target
* source type.
- *
+ *
* @author Dave Syer
- *
+ *
*/
+@SuppressWarnings({ "serial", "rawtypes" })
public class PlaceholderProxyFactoryBean extends ProxyConfig implements FactoryBean, BeanFactoryAware {
/** The TargetSource that manages scoping */
@@ -74,7 +75,7 @@ public class PlaceholderProxyFactoryBean extends ProxyConfig implements FactoryB
this.scopedTargetSource.setTargetBeanName(targetBeanName);
}
- @Override
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
if (!(beanFactory instanceof ConfigurableBeanFactory)) {
throw new IllegalStateException("Not running in a ConfigurableBeanFactory: " + beanFactory);
@@ -105,13 +106,13 @@ public class PlaceholderProxyFactoryBean extends ProxyConfig implements FactoryB
// proxy itself is not subject to auto-proxying! Only its target bean
// is.
pf.addInterface(AopInfrastructureBean.class);
-
+
this.scopedTargetSource.afterPropertiesSet();
this.proxy = pf.getProxy(cbf.getBeanClassLoader());
}
- @Override
+ @Override
public Object getObject() {
if (this.proxy == null) {
throw new FactoryBeanNotInitializedException();
@@ -119,7 +120,7 @@ public class PlaceholderProxyFactoryBean extends ProxyConfig implements FactoryB
return this.proxy;
}
- @Override
+ @Override
public Class> getObjectType() {
if (this.proxy != null) {
return this.proxy.getClass();
@@ -130,7 +131,7 @@ public class PlaceholderProxyFactoryBean extends ProxyConfig implements FactoryB
return null;
}
- @Override
+ @Override
public boolean isSingleton() {
return true;
}
@@ -139,7 +140,7 @@ public class PlaceholderProxyFactoryBean extends ProxyConfig implements FactoryB
* Convenience method to create a {@link BeanDefinition} for a target
* wrapped in a placeholder tarrget source, able to defer binding of
* placeholders until the bean is used.
- *
+ *
* @param definition a target bean definition
* @param registry a {@link BeanDefinitionRegistry}
* @param proxyTargetClass true if we need to use CGlib to create the
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/util/StepContextFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/util/StepContextFactory.java
index e388c0ac0..19f1cc560 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/util/StepContextFactory.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/util/StepContextFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,18 +22,18 @@ import org.springframework.batch.core.scope.context.StepSynchronizationManager;
/**
* Implementation of {@link ContextFactory} that provides the current
* {@link StepContext} as a context object.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class StepContextFactory implements ContextFactory {
- @Override
+ @Override
public Object getContext() {
return StepSynchronizationManager.getContext();
}
- @Override
+ @Override
public String getContextId() {
StepContext context = StepSynchronizationManager.getContext();
return context!=null ? (String) context.getId() : "sysinit";
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java
index bfe1a1d7f..91bf92520 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ import org.springframework.util.ClassUtils;
/**
* A {@link Step} implementation that provides common behavior to subclasses, including registering and calling
* listeners.
- *
+ *
* @author Dave Syer
* @author Ben Hale
* @author Robert Kasanicky
@@ -67,20 +67,20 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
super();
}
- @Override
+ @Override
public void afterPropertiesSet() throws Exception {
Assert.state(name != null, "A Step must have a name");
Assert.state(jobRepository != null, "JobRepository is mandatory");
}
- @Override
+ @Override
public String getName() {
return this.name;
}
/**
* Set the name property. Always overrides the default value if this object is a Spring bean.
- *
+ *
* @see #setBeanName(java.lang.String)
*/
public void setName(String name) {
@@ -91,31 +91,31 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
* Set the name property if it is not already set. Because of the order of the callbacks in a Spring container the
* name property will be set first if it is present. Care is needed with bean definition inheritance - if a parent
* bean has a name, then its children need an explicit name as well, otherwise they will not be unique.
- *
+ *
* @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String)
*/
- @Override
+ @Override
public void setBeanName(String name) {
if (this.name == null) {
this.name = name;
}
}
- @Override
+ @Override
public int getStartLimit() {
return this.startLimit;
}
/**
* Public setter for the startLimit.
- *
+ *
* @param startLimit the startLimit to set
*/
public void setStartLimit(int startLimit) {
this.startLimit = startLimit;
}
- @Override
+ @Override
public boolean isAllowStartIfComplete() {
return this.allowStartIfComplete;
}
@@ -123,7 +123,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Public setter for flag that determines whether the step should start again if it is already complete. Defaults to
* false.
- *
+ *
* @param allowStartIfComplete the value of the flag to set
*/
public void setAllowStartIfComplete(boolean allowStartIfComplete) {
@@ -132,7 +132,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Convenient constructor for setting only the name property.
- *
+ *
* @param name
*/
public AbstractStep(String name) {
@@ -142,7 +142,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Extension point for subclasses to execute business logic. Subclasses should set the {@link ExitStatus} on the
* {@link StepExecution} before returning.
- *
+ *
* @param stepExecution the current step context
* @throws Exception
*/
@@ -151,7 +151,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Extension point for subclasses to provide callbacks to their collaborators at the beginning of a step, to open or
* acquire resources. Does nothing by default.
- *
+ *
* @param ctx the {@link ExecutionContext} to use
* @throws Exception
*/
@@ -161,7 +161,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Extension point for subclasses to provide callbacks to their collaborators at the end of a step (right at the end
* of the finally block), to close or release resources. Does nothing by default.
- *
+ *
* @param ctx the {@link ExecutionContext} to use
* @throws Exception
*/
@@ -173,9 +173,9 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
* {@link #open(ExecutionContext)}), execution logic ({@link #doExecute(StepExecution)}) and resource closing (
* {@link #close(ExecutionContext)}).
*/
- @Override
+ @Override
public final void execute(StepExecution stepExecution) throws JobInterruptedException,
- UnexpectedJobExecutionException {
+ UnexpectedJobExecutionException {
logger.debug("Executing: id=" + stepExecution.getId());
stepExecution.setStartTime(new Date());
@@ -288,7 +288,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Register a step listener for callbacks at the appropriate stages in a step execution.
- *
+ *
* @param listener a {@link StepExecutionListener}
*/
public void registerStepExecutionListener(StepExecutionListener listener) {
@@ -297,7 +297,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Register each of the objects as listeners.
- *
+ *
* @param listeners an array of listener objects of known types.
*/
public void setStepExecutionListeners(StepExecutionListener[] listeners) {
@@ -315,7 +315,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Public setter for {@link JobRepository}.
- *
+ *
* @param jobRepository is a mandatory dependence (no default).
*/
public void setJobRepository(JobRepository jobRepository) {
@@ -326,7 +326,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
return jobRepository;
}
- @Override
+ @Override
public String toString() {
return ClassUtils.getShortName(getClass()) + ": [name=" + name + "]";
}
@@ -334,7 +334,7 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
/**
* Default mapping from throwable to {@link ExitStatus}. Clients can modify the exit code using a
* {@link StepExecutionListener}.
- *
+ *
* @param ex the cause of the failure
* @return an {@link ExitStatus}
*/
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/NoWorkFoundStepExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/NoWorkFoundStepExecutionListener.java
index 63182b3d7..8aced0999 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/NoWorkFoundStepExecutionListener.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/NoWorkFoundStepExecutionListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,12 +22,12 @@ import org.springframework.batch.core.listener.StepExecutionListenerSupport;
/**
* Fails the step if no items have been processed ( item count is 0).
- *
+ *
* @author Robert Kasanicky
*/
public class NoWorkFoundStepExecutionListener extends StepExecutionListenerSupport {
- @Override
+ @Override
public ExitStatus afterStep(StepExecution stepExecution) {
if (stepExecution.getReadCount() == 0) {
return ExitStatus.FAILED;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/StepLocatorStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/StepLocatorStepFactoryBean.java
index da0636330..7345c6d54 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/StepLocatorStepFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/StepLocatorStepFactoryBean.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2012-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.batch.core.step;
import org.springframework.batch.core.Job;
@@ -8,9 +23,9 @@ import org.springframework.beans.factory.FactoryBean;
* Convenience factory for {@link Step} instances given a {@link StepLocator}.
* Most implementations of {@link Job} implement StepLocator, so that can be a
* good starting point.
- *
+ *
* @author Dave Syer
- *
+ *
*/
public class StepLocatorStepFactoryBean implements FactoryBean {
@@ -33,30 +48,30 @@ public class StepLocatorStepFactoryBean implements FactoryBean {
}
/**
- *
+ *
* @see FactoryBean#getObject()
*/
- @Override
+ @Override
public Step getObject() throws Exception {
return stepLocator.getStep(stepName);
}
/**
* Tell clients that we are a factory for {@link Step} instances.
- *
+ *
* @see FactoryBean#getObjectType()
*/
- @Override
+ @Override
public Class extends Step> getObjectType() {
return Step.class;
}
/**
* Always return true as optimization for bean factory.
- *
+ *
* @see FactoryBean#isSingleton()
*/
- @Override
+ @Override
public boolean isSingleton() {
return true;
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/ThreadStepInterruptionPolicy.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/ThreadStepInterruptionPolicy.java
index 6bc2077d6..daed5d7d1 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/ThreadStepInterruptionPolicy.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/ThreadStepInterruptionPolicy.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,10 +23,10 @@ import org.springframework.batch.core.StepExecution;
/**
* Policy that checks the current thread to see if it has been interrupted.
- *
+ *
* @author Lucas Ward
* @author Dave Syer
- *
+ *
*/
public class ThreadStepInterruptionPolicy implements StepInterruptionPolicy {
@@ -36,7 +36,7 @@ public class ThreadStepInterruptionPolicy implements StepInterruptionPolicy {
* Returns if the current job lifecycle has been interrupted by checking if
* the current thread is interrupted.
*/
- @Override
+ @Override
public void checkInterrupted(StepExecution stepExecution) throws JobInterruptedException {
if (isInterrupted(stepExecution)) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java
index dd43ce27e..2e0dec69c 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/builder/FaultTolerantStepBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2012 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -73,9 +73,9 @@ import org.springframework.util.Assert;
/**
* A step builder for fully fault tolerant chunk-oriented item processing steps. Extends {@link SimpleStepBuilder} with
* additional properties for retry and skip of failed items.
- *
+ *
* @author Dave Syer
- *
+ *
* @since 2.2
*/
public class FaultTolerantStepBuilder extends SimpleStepBuilder {
@@ -116,7 +116,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used.
- *
+ *
* @param parent a parent helper containing common step properties
*/
public FaultTolerantStepBuilder(StepBuilderHelper> parent) {
@@ -125,7 +125,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used.
- *
+ *
* @param parent a parent helper containing common step properties
*/
protected FaultTolerantStepBuilder(SimpleStepBuilder parent) {
@@ -134,7 +134,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Create a new chunk oriented tasklet with reader, writer and processor as provided.
- *
+ *
* @see org.springframework.batch.core.step.builder.SimpleStepBuilder#createTasklet()
*/
@Override
@@ -152,7 +152,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Register a skip listener.
- *
+ *
* @param listener the listener to register
* @return this for fluent chaining
*/
@@ -175,7 +175,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Register a retry listener.
- *
+ *
* @param listener the listener to register
* @return this for fluent chaining
*/
@@ -190,7 +190,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
* own implementation to ensure that they can be identified. Often a key generator is not necessary as long as the
* items have reliable hash code and equals implementations, or the reader is not transactional (the default) and
* the item processor either is itself not transactional (not the default) or does not create new items.
- *
+ *
* @param keyGenerator a key generator for the stateful retry
* @return this for fluent chaining
*/
@@ -202,7 +202,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* The maximum number of times to try a failed item. Zero and one both translate to try only once and do not retry.
* Ignored if an explicit {@link #retryPolicy} is set.
- *
+ *
* @param retryLimit the retry limit (default 0)
* @return this for fluent chaining
*/
@@ -214,7 +214,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Provide an explicit retry policy instead of using the {@link #retryLimit(int)} and retryable exceptions provided
* elsewhere. Can be used to retry different exceptions a different number of times, for instance.
- *
+ *
* @param retryPolicy a retry policy
* @return this for fluent chaining
*/
@@ -227,7 +227,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
* Provide a backoff policy to prevent items being retried immediately (e.g. in case the failure was caused by a
* remote resource failure that might take some time to be resolved). Ignored if an explicit {@link #retryPolicy} is
* set.
- *
+ *
* @param backOffPolicy the back off policy to use (default no backoff)
* @return this for fluent chaining
*/
@@ -239,7 +239,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Provide an explicit retry context cache. Retry is stateful across transactions in the case of failures in item
* processing or writing, so some information about the context for subsequent retries has to be stored.
- *
+ *
* @param retryContextCache cache for retry contexts in between transactions (default to standard in-memory
* implementation)
* @return this for fluent chaining
@@ -252,7 +252,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Sets the maximium number of failed items to skip before the step fails. Ignored if an explicit
* {@link #skipPolicy(SkipPolicy)} is provided.
- *
+ *
* @param skipLimit the skip limit to set
* @return this for fluent chaining
*/
@@ -263,7 +263,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Explicitly prevent certain exceptions (and subclasses) from being skipped.
- *
+ *
* @param type the non-skippable exception
* @return this for fluent chaining
*/
@@ -274,7 +274,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Explicitly request certain exceptions (and subclasses) to be skipped.
- *
+ *
* @param type
* @return this for fluent chaining
*/
@@ -286,7 +286,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Provide an explicit policy for managing skips. A skip policy determines which exceptions are skippable and how
* many times.
- *
+ *
* @param skipPolicy the skip policy
* @return this for fluent chaining
*/
@@ -299,7 +299,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
* Mark this exception as ignorable during item read or processing operations. Processing continues with no
* additional callbacks (use skips instead if you need to be notified). Ignored during write because there is no
* guarantee of skip and retry without rollback.
- *
+ *
* @param type the exception to mark as no rollback
* @return this for fluent chaining
*/
@@ -310,7 +310,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Explicitly ask for an exception (and subclasses) to be excluded from retry.
- *
+ *
* @param type the exception to exclude from retry
* @return this for fluent chaining
*/
@@ -321,7 +321,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Explicitly ask for an exception (and subclasses) to be retried.
- *
+ *
* @param type the exception to retry
* @return this for fluent chaining
*/
@@ -334,7 +334,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
* Mark the item processor as non-transactional (default is the opposite). If this flag is set the results of item
* processing are cached across transactions in between retries and during skip processing, otherwise the processor
* will be called in every transaction.
- *
+ *
* @return this for fluent chaining
*/
public FaultTolerantStepBuilder processorNonTransactional() {
@@ -446,7 +446,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Convenience method to get an exception classifier based on the provided transaction attributes.
- *
+ *
* @return an exception classifier: maps to true if an exception should cause rollback
*/
private Classifier getRollbackClassifier() {
@@ -466,7 +466,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
final Classifier panic = new BinaryExceptionClassifier(types, true);
classifier = new Classifier() {
- @Override
+ @Override
public Boolean classify(Throwable classifiable) {
// Rollback if either the user's list or our own applies
return panic.classify(classifiable) || binary.classify(classifiable);
@@ -479,6 +479,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
}
+ @SuppressWarnings("serial")
private TransactionAttribute getTransactionAttribute(TransactionAttribute attribute) {
final Classifier classifier = getRollbackClassifier();
@@ -584,7 +585,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
/**
* Wrap a {@link SkipPolicy} and make it consistent with known fatal exceptions.
- *
+ *
* @param skipPolicy an existing skip policy
* @return a skip policy that will not skip fatal exceptions
*/
@@ -627,16 +628,16 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
exceptions.add(fatal);
}
}
- nonRetryableExceptionClasses = (List>) exceptions;
+ nonRetryableExceptionClasses = exceptions;
}
/**
* ChunkListener that wraps exceptions thrown from the ChunkListener in {@link FatalStepExecutionException} to force
* termination of StepExecution
- *
+ *
* ChunkListeners shoulnd't throw exceptions and expect continued processing, they must be handled in the
* implementation or the step will terminate
- *
+ *
*/
private class TerminateOnExceptionChunkListenerDelegate implements ChunkListener {
@@ -646,7 +647,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
this.chunkListener = chunkListener;
}
- @Override
+ @Override
public void beforeChunk() {
try {
chunkListener.beforeChunk();
@@ -656,7 +657,7 @@ public class FaultTolerantStepBuilder extends SimpleStepBuilder {
}
}
- @Override
+ @Override
public void afterChunk() {
try {
chunkListener.afterChunk();
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/FaultTolerantStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/FaultTolerantStepFactoryBean.java
index 7a7ca8df9..566847214 100755
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/FaultTolerantStepFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/factory/FaultTolerantStepFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,20 +35,18 @@ import org.springframework.retry.policy.MapRetryContextCache;
import org.springframework.retry.policy.RetryContextCache;
/**
- * Factory bean for step that provides options for configuring skip behaviour. User can set {@link #setSkipLimit(int)}
- * to set how many exceptions of {@link #setSkippableExceptionClasses(Collection)} types are tolerated.
- * {@link #setFatalExceptionClasses(Collection)} will cause immediate termination of job - they are treated as higher
- * priority than {@link #setSkippableExceptionClasses(Collection)}, so the two lists don't need to be exclusive.
- *
+ * Factory bean for step that provides options for configuring skip behavior. User can set {@link #setSkipLimit(int)}
+ * to set how many exceptions of {@link #setSkippableExceptionClasses(Map)} types are tolerated.
+ *
* Skippable exceptions on write will by default cause transaction rollback - to avoid rollback for specific exception
* class include it in the transaction attribute as "no rollback for".
- *
+ *
* @see SimpleStepFactoryBean
- *
+ *
* @author Dave Syer
* @author Robert Kasanicky
* @author Morten Andersen-Gott
- *
+ *
*/
public class FaultTolerantStepFactoryBean extends SimpleStepFactoryBean {
@@ -81,7 +79,7 @@ public class FaultTolerantStepFactoryBean extends SimpleStepFactoryBean extends SimpleStepFactoryBean extends SimpleStepFactoryBeanretryLimit == 1 by default.
- *
+ *
* @param retryLimit the retry limit to set, must be greater or equal to 1.
*/
public void setRetryLimit(int retryLimit) {
@@ -112,13 +110,13 @@ public class FaultTolerantStepFactoryBean extends SimpleStepFactoryBean
- *
+ *
* The default value should be high enough and more for most purposes. To breach the limit in a single-threaded step
* typically you have to have this many failures in a single transaction. Defaults to the value in the
* {@link MapRetryContextCache}.
- *
+ *
* This property is ignored if the {@link #setRetryContextCache(RetryContextCache)} is set directly.
- *
+ *
* @param cacheCapacity the cache capacity to set (greater than 0 else ignored)
*/
public void setCacheCapacity(int cacheCapacity) {
@@ -128,7 +126,7 @@ public class FaultTolerantStepFactoryBean extends SimpleStepFactoryBean extends SimpleStepFactoryBean, Boolean> retryableExceptionClasses) {
@@ -146,7 +144,7 @@ public class FaultTolerantStepFactoryBean extends SimpleStepFactoryBean extends SimpleStepFactoryBean extends SimpleStepFactoryBean extends SimpleStepFactoryBean