| 1 | /* |
| 2 | * Copyright 2006-2008 the original author or authors. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.springframework.batch.core.listener; |
| 17 | |
| 18 | import org.springframework.batch.core.ItemReadListener; |
| 19 | import org.springframework.batch.core.ItemWriteListener; |
| 20 | |
| 21 | /** |
| 22 | * Basic no-op implementation of both the {@link ItemWriteListener} and |
| 23 | * {@link ItemReadListener} interfaces. Both are implemented, since it is |
| 24 | * very common that both may need to be implemented at once. |
| 25 | * |
| 26 | * @author Lucas Ward |
| 27 | * |
| 28 | */ |
| 29 | public class ItemListenerSupport implements ItemWriteListener, ItemReadListener { |
| 30 | |
| 31 | /* (non-Javadoc) |
| 32 | * @see org.springframework.batch.core.domain.ItemWriteListener#afterWrite() |
| 33 | */ |
| 34 | public void afterWrite(Object item) { |
| 35 | } |
| 36 | |
| 37 | /* (non-Javadoc) |
| 38 | * @see org.springframework.batch.core.domain.ItemWriteListener#beforeWrite(java.lang.Object) |
| 39 | */ |
| 40 | public void beforeWrite(Object item) { |
| 41 | } |
| 42 | |
| 43 | /* (non-Javadoc) |
| 44 | * @see org.springframework.batch.core.domain.ItemWriteListener#onWriteError(java.lang.Exception, java.lang.Object) |
| 45 | */ |
| 46 | public void onWriteError(Exception ex, Object item) { |
| 47 | } |
| 48 | |
| 49 | /* (non-Javadoc) |
| 50 | * @see org.springframework.batch.core.domain.ItemReadListener#afterRead(java.lang.Object) |
| 51 | */ |
| 52 | public void afterRead(Object item) { |
| 53 | } |
| 54 | |
| 55 | /* (non-Javadoc) |
| 56 | * @see org.springframework.batch.core.domain.ItemReadListener#beforeRead() |
| 57 | */ |
| 58 | public void beforeRead() { |
| 59 | } |
| 60 | |
| 61 | /* (non-Javadoc) |
| 62 | * @see org.springframework.batch.core.domain.ItemReadListener#onReadError(java.lang.Exception) |
| 63 | */ |
| 64 | public void onReadError(Exception ex) { |
| 65 | } |
| 66 | |
| 67 | } |