View Javadoc

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  
17  package org.springframework.batch.repeat.support;
18  
19  import org.springframework.batch.repeat.RepeatStatus;
20  import org.springframework.batch.repeat.RepeatContext;
21  
22  /**
23   * Interface for result holder. 
24   * 
25   * @author Dave Syer
26   */
27  interface ResultHolder {
28  	/**
29  	 * Get the result for client from this holder. Does not block if none is
30  	 * available yet.
31  	 * 
32  	 * @return the result, or null if there is none.
33  	 * @throws IllegalStateException
34  	 */
35  	RepeatStatus getResult();
36  
37  	/**
38  	 * Get the error for client from this holder if any. Does not block if
39  	 * none is available yet.
40  	 * 
41  	 * @return the error, or null if there is none.
42  	 * @throws IllegalStateException
43  	 */
44  	Throwable getError();
45  
46  	/**
47  	 * Get the context in which the result evaluation is executing.
48  	 * 
49  	 * @return the context of the result evaluation.
50  	 */
51  	RepeatContext getContext();
52  }