Add BeanCreationException to list of standard failure exceptions

Without this change, when passing an invalid job parameter to a bean
that is created internally by Spring Batch will cause a
BeanCreationException that is essentially ignored.  Due to it being
ignored, an infinite loop occurs in processing.
This commit is contained in:
Michael Minella
2014-09-16 10:44:05 -05:00
parent 1e54018df3
commit 04b339b8f4
7 changed files with 158 additions and 21 deletions

View File

@@ -0,0 +1,40 @@
/*
* Copyright 2014 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.item.support;
import org.springframework.batch.item.ItemWriter;
import java.util.ArrayList;
import java.util.List;
/**
* @author mminella
*/
public class ListItemWriter<T> implements ItemWriter<T> {
private List<T> writtenItems = new ArrayList<T>();
@Override
public void write(List<? extends T> items) throws Exception {
for (T item : items) {
writtenItems.add(item);
}
}
public List<? extends T> getWrittenItems() {
return this.writtenItems;
}
}