Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,28 @@ public B listener(JobExecutionListener listener) {
return result;
}

/**
* Add a {@link JobExecutionListener} to the job.
* This method makes the additive nature of adding listeners explicit.
* @param listener the job execution listener to add
* @return this for fluent chaining
* @since 6.1
*/
public B addListener(JobExecutionListener listener) {
return listener(listener);
}

/**
* Add a job execution listener using annotation-based configuration.
* This method makes the additive nature of adding listeners explicit.
* @param listener the object that has a method configured with listener annotation
* @return this for fluent chaining
* @since 6.1
*/
public B addListener(Object listener) {
return listener(listener);
}

/**
* Set a flag to prevent restart an execution of this job even if it has failed.
* @return this to enable fluent chaining
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,28 @@ public B listener(StepExecutionListener listener) {
return self();
}

/**
* Add a {@link StepExecutionListener} to the step.
* This method makes the additive nature of adding listeners explicit.
* @param listener the step execution listener to add
* @return this for fluent chaining
* @since 6.1
*/
public B addListener(StepExecutionListener listener) {
return listener(listener);
}

/**
* Add a step execution listener using annotation-based configuration.
* This method makes the additive nature of adding listeners explicit.
* @param listener the object that has a method configured with listener annotation
* @return this for fluent chaining
* @since 6.1
*/
public B addListener(Object listener) {
return listener(listener);
}

public B allowStartIfComplete(boolean allowStartIfComplete) {
properties.allowStartIfComplete = allowStartIfComplete;
return self();
Expand Down