BATCH-1183: Implement toString() on Step implementations

This commit is contained in:
dhgarrette
2009-03-30 14:29:19 +00:00
parent aac13324df
commit 246b1a61b6
2 changed files with 9 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ package org.springframework.batch.core.configuration.xml;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.util.ClassUtils;
/**
* Class used for delegating from a <step> definition to an individual bean
@@ -61,4 +62,7 @@ public class DelegatingStep implements Step {
return delegate.isAllowStartIfComplete();
}
public String toString() {
return ClassUtils.getShortName(getClass()) + ": [name=" + name + "]";
}
}

View File

@@ -38,6 +38,7 @@ import org.springframework.batch.repeat.RepeatException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
/**
* A {@link Step} implementation that provides common behavior to subclasses,
@@ -318,6 +319,10 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw
return jobRepository;
}
public String toString() {
return ClassUtils.getShortName(getClass()) + ": [name=" + name + "]";
}
/**
* Default mapping from throwable to {@link ExitStatus}. Clients can modify
* the exit code using a {@link StepExecutionListener}.