BATCH-1780: Updated usage of StepLIstenerFailedException to match doc
This commit is contained in:
@@ -30,7 +30,7 @@ import org.springframework.batch.item.ItemStream;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MulticasterBatchListener<T, S> implements StepExecutionListener, ChunkListener, ItemReadListener<T>,
|
||||
ItemProcessListener<T, S>, ItemWriteListener<S>, SkipListener<T, S> {
|
||||
@@ -57,7 +57,7 @@ public class MulticasterBatchListener<T, S> implements StepExecutionListener, Ch
|
||||
/**
|
||||
* Register each of the objects as listeners. Once registered, calls to the
|
||||
* {@link MulticasterBatchListener} broadcast to the individual listeners.
|
||||
*
|
||||
*
|
||||
* @param listeners listener objects of types known to the multicaster.
|
||||
*/
|
||||
public void setListeners(List<? extends StepListener> listeners) {
|
||||
@@ -169,7 +169,7 @@ public class MulticasterBatchListener<T, S> implements StepExecutionListener, Ch
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @see org.springframework.batch.core.listener.CompositeChunkListener#afterChunk()
|
||||
*/
|
||||
public void afterChunk() {
|
||||
@@ -182,7 +182,7 @@ public class MulticasterBatchListener<T, S> implements StepExecutionListener, Ch
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @see org.springframework.batch.core.listener.CompositeChunkListener#beforeChunk()
|
||||
*/
|
||||
public void beforeChunk() {
|
||||
@@ -208,7 +208,7 @@ public class MulticasterBatchListener<T, S> implements StepExecutionListener, Ch
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @see org.springframework.batch.core.listener.CompositeItemReadListener#beforeRead()
|
||||
*/
|
||||
public void beforeRead() {
|
||||
@@ -229,12 +229,12 @@ public class MulticasterBatchListener<T, S> implements StepExecutionListener, Ch
|
||||
itemReadListener.onReadError(ex);
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
throw new StepListenerFailedException("Error in onReadError.", ex, e);
|
||||
throw new StepListenerFailedException("Error in onReadError.", e, ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @see ItemWriteListener#afterWrite(List)
|
||||
*/
|
||||
public void afterWrite(List<? extends S> items) {
|
||||
@@ -269,7 +269,7 @@ public class MulticasterBatchListener<T, S> implements StepExecutionListener, Ch
|
||||
itemWriteListener.onWriteError(ex, items);
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
throw new StepListenerFailedException("Error in onWriteError.", ex, e);
|
||||
throw new StepListenerFailedException("Error in onWriteError.", e, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.batch.core.listener;
|
||||
|
||||
/**
|
||||
* Exception to indicate a problem in a step listener.
|
||||
*
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
@@ -37,8 +37,8 @@ public class StepListenerFailedException extends RuntimeException {
|
||||
* @param ex the exception that was thrown by a listener
|
||||
* @param e the exception that caused the skip
|
||||
*/
|
||||
public StepListenerFailedException(String message, Throwable ex, RuntimeException e) {
|
||||
super(message + "\n" + e.getClass().getName() + ": " + e.getMessage(), ex);
|
||||
public StepListenerFailedException(String message, RuntimeException ex, Throwable e) {
|
||||
super(message + "\n" + e.getMessage() + ": " + e.getClass().getName(), ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user