@Deprecated
public synchronized Batch execute() {
configureLogging();
- start().executeTask(bootstrapProperties).stop();
+ start();
+ boolean threw = true;
+ try {
+ executeTask(bootstrapProperties);
+ threw = false;
+ } finally {
+ doStop(threw);
+ }
+
return this;
}
* @since 4.4
*/
public synchronized void stop() {
+ doStop(false);
+ }
+
+ private void doStop(boolean swallowException) {
if (!started) {
throw new IllegalStateException("Batch is not started.");
}
- bootstrapContainer.stopComponents();
+ bootstrapContainer.stopComponents(swallowException);
this.started = false;
}