类 RepeatOperationsInterceptor
- java.lang.Object
- org.springframework.batch.repeat.interceptor.RepeatOperationsInterceptor
- 所有已实现的接口:
org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor
public class RepeatOperationsInterceptor extends java.lang.Object implements org.aopalliance.intercept.MethodInterceptor
AMethodInterceptorthat can be used to automatically repeat calls to a method on a service. The injectedRepeatOperationsis used to control the completion of the loop. Independent of the completion policy in theRepeatOperationsthe loop will repeat until the target method returns null or false. Be careful when injecting a bespokeRepeatOperationsthat the loop will actually terminate, because the default policy for a vanillaRepeatTemplatewill never complete if the return type of the target method is void (the value returned is always not-null, representing theVoid.TYPE).- 作者:
- Dave Syer
构造器概要
构造器 构造器 说明 RepeatOperationsInterceptor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.lang.Objectinvoke(org.aopalliance.intercept.MethodInvocation invocation)Invoke the proceeding method call repeatedly, according to the properties of the injectedRepeatOperations.voidsetRepeatOperations(RepeatOperations batchTemplate)Setter for theRepeatOperations.
构造器详细资料
RepeatOperationsInterceptor
public RepeatOperationsInterceptor()
方法详细资料
setRepeatOperations
public void setRepeatOperations(RepeatOperations batchTemplate)
Setter for theRepeatOperations.- 参数:
batchTemplate- template to be used- 抛出:
java.lang.IllegalArgumentException- if the argument is null.
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable
Invoke the proceeding method call repeatedly, according to the properties of the injectedRepeatOperations.- 指定者:
invoke在接口中org.aopalliance.intercept.MethodInterceptor- 抛出:
java.lang.Throwable- 另请参阅:
MethodInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)