diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/stream/SimpleStreamManager.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/stream/SimpleStreamManager.java index 5d8ff30dd..54aa9150d 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/stream/SimpleStreamManager.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/stream/SimpleStreamManager.java @@ -44,7 +44,7 @@ public class SimpleStreamManager implements StreamManager { * Simple aggregate statistics provider for the contributions registered * under the given key. * - * @see org.springframework.batch.statistics.StatisticsService#getStatistics(java.lang.Object) + * @see org.springframework.batch.item.stream.StreamManager#getStreamContext(java.lang.Object) */ public StreamContext getStreamContext(Object key) { Set set = new LinkedHashSet(); @@ -82,8 +82,7 @@ public class SimpleStreamManager implements StreamManager { * Register a {@link ItemStream} as one of the interesting providers under * the provided key. * - * @see org.springframework.batch.statistics.StreamManager#register(java.lang.Object, - * org.springframework.batch.statistics.StatisticsProvider) + * @see org.springframework.batch.item.stream.StreamManager#register(java.lang.Object, org.springframework.batch.item.ItemStream) */ public void register(Object key, ItemStream provider) { synchronized (registry) { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/StatisticsRetryInterceptor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/StatisticsRetryInterceptor.java deleted file mode 100644 index 9cd530d2e..000000000 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/StatisticsRetryInterceptor.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2006-2007 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.retry.interceptor; - -import org.springframework.batch.retry.RetryCallback; -import org.springframework.batch.retry.RetryContext; -import org.springframework.batch.retry.RetryInterceptor; -import org.springframework.batch.retry.RetryStatistics; - -/** - * A {@link RetryInterceptor} that counts the number of attempts, errors and - * successful retry operations. - * - * @author Dave Syer - * - */ -public class StatisticsRetryInterceptor extends RetryInterceptorSupport implements RetryStatistics { - - private int startedCount; - - private int completeCount; - - private int errorCount; - - private int abortCount; - - private String name; - - public synchronized int getAbortCount() { - return abortCount; - } - - public synchronized int getCompleteCount() { - return completeCount; - } - - public synchronized int getErrorCount() { - return errorCount; - } - - public synchronized int getStartedCount() { - return startedCount; - } - - public String getName() { - return name == null ? this.toString() : name; - } - - public void setName(String name) { - this.name = name; - } - - public synchronized boolean open(RetryContext context, RetryCallback callback) { - startedCount++; - return super.open(context, callback); - } - - public synchronized void onError(RetryContext context, RetryCallback callback, Throwable throwable) { - errorCount++; - super.onError(context, callback, throwable); - } - - public synchronized void close(RetryContext context, RetryCallback callback, Throwable throwable) { - if (throwable != null) { - abortCount++; - } - else { - completeCount++; - } - super.close(context, callback, throwable); - } - -} diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/StatisticsRetryInterceptorTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/StatisticsRetryInterceptorTests.java deleted file mode 100644 index 293faa4ba..000000000 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/StatisticsRetryInterceptorTests.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2006-2007 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.retry.interceptor; - -import junit.framework.TestCase; - -public class StatisticsRetryInterceptorTests extends TestCase { - - StatisticsRetryInterceptor interceptor = new StatisticsRetryInterceptor(); - - public void testGetAbortCount() { - assertEquals(0, interceptor.getAbortCount()); - interceptor.close(null, null, null); - assertEquals(0, interceptor.getAbortCount()); - interceptor.close(null, null, new Exception()); - assertEquals(1, interceptor.getAbortCount()); - } - - public void testGetCompleteCount() { - assertEquals(0, interceptor.getCompleteCount()); - interceptor.close(null, null, null); - assertEquals(1, interceptor.getCompleteCount()); - } - - public void testGetErrorCount() { - assertEquals(0, interceptor.getErrorCount()); - interceptor.onError(null, null, null); - assertEquals(1, interceptor.getErrorCount()); - } - - public void testGetStartedCount() { - assertEquals(0, interceptor.getStartedCount()); - interceptor.open(null, null); - assertEquals(1, interceptor.getStartedCount()); - } - - public void testGetName() { - assertNotNull(interceptor.getName()); - interceptor.setName("foo"); - assertEquals("foo", interceptor.getName()); - } - -}