EMMA Coverage Report (generated Fri Jan 30 13:20:29 EST 2009)
[all classes][org.springframework.batch.repeat.callback]

COVERAGE SUMMARY FOR SOURCE FILE [NestedRepeatCallback.java]

nameclass, %method, %block, %line, %
NestedRepeatCallback.java100% (1/1)100% (2/2)100% (15/15)100% (5/5)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NestedRepeatCallback100% (1/1)100% (2/2)100% (15/15)100% (5/5)
NestedRepeatCallback (RepeatOperations, RepeatCallback): void 100% (1/1)100% (9/9)100% (4/4)
doInIteration (RepeatContext): ExitStatus 100% (1/1)100% (6/6)100% (1/1)

1/*
2 * Copyright 2006-2007 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 
17package org.springframework.batch.repeat.callback;
18 
19import org.springframework.batch.repeat.ExitStatus;
20import org.springframework.batch.repeat.RepeatCallback;
21import org.springframework.batch.repeat.RepeatContext;
22import org.springframework.batch.repeat.RepeatOperations;
23 
24/**
25 * Callback that delegates to another callback, via a {@link RepeatOperations} instance.
26 * Useful when nesting or composing batches in one another, e.g. for breaking a
27 * batch down into chunks.
28 * 
29 * @author Dave Syer
30 * 
31 */
32public class NestedRepeatCallback implements RepeatCallback {
33 
34        private RepeatOperations template;
35 
36        private RepeatCallback callback;
37 
38        /**
39         * Constructor setting mandatory fields.
40         * 
41         * @param template the {@link RepeatOperations} to use when calling the delegate
42         * callback
43         * @param callback the {@link RepeatCallback} delegate
44         */
45        public NestedRepeatCallback(RepeatOperations template, RepeatCallback callback) {
46                super();
47                this.template = template;
48                this.callback = callback;
49        }
50 
51        /**
52         * Simply calls template.execute(callback). Clients can use this to repeat a
53         * batch process, or to break a process up into smaller chunks (e.g. to
54         * change the transaction boundaries).
55         * 
56         * @see org.springframework.batch.repeat.RepeatCallback#doInIteration(RepeatContext)
57         */
58        public ExitStatus doInIteration(RepeatContext context) throws Exception {
59                return template.iterate(callback);
60        }
61}

[all classes][org.springframework.batch.repeat.callback]
EMMA 2.0.5312 (C) Vladimir Roubtsov