类 RepeatContextSupport
- java.lang.Object
- org.springframework.batch.repeat.context.SynchronizedAttributeAccessor
- org.springframework.batch.repeat.context.RepeatContextSupport
- 所有已实现的接口:
RepeatContext
,org.springframework.core.AttributeAccessor
- 直接已知子类:
CompositeCompletionPolicy.CompositeBatchContext
,CountingCompletionPolicy.CountingBatchContext
,SimpleCompletionPolicy.SimpleTerminationContext
,TimeoutTerminationPolicy.TimeoutBatchContext
public class RepeatContextSupport extends SynchronizedAttributeAccessor implements RepeatContext
构造器概要
构造器 构造器 说明 RepeatContextSupport(RepeatContext parent)
Constructor forRepeatContextSupport
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
close()
Allow resources to be cleared, especially in destruction callbacks.RepeatContext
getParent()
If batches are nested, then the inner batch will be created with the outer one as a parent.int
getStartedCount()
Public access to a counter for the number of operations attempted.void
increment()
Used by clients to increment the started count.boolean
isCompleteOnly()
Public accessor for the complete flag.boolean
isTerminateOnly()
Public accessor for the termination flag.void
registerDestructionCallback(java.lang.String name, java.lang.Runnable callback)
Register a callback to be executed on close, associated with the attribute having the given name.void
setCompleteOnly()
Signal to the framework that the current batch should complete normally, independent of the currentCompletionPolicy
.void
setTerminateOnly()
Signal to the framework that the current batch should complete abnormally, independent of the currentCompletionPolicy
.从类继承的方法 org.springframework.batch.repeat.context.SynchronizedAttributeAccessor
attributeNames, equals, getAttribute, hasAttribute, hashCode, removeAttribute, setAttribute, setAttributeIfAbsent, toString
构造器详细资料
RepeatContextSupport
public RepeatContextSupport(RepeatContext parent)
Constructor forRepeatContextSupport
. The parent can be null, but should be set to the enclosing repeat context if there is one, e.g. if this context is an inner loop.- 参数:
parent
-RepeatContext
to be used as the parent context.
方法详细资料
isCompleteOnly
public boolean isCompleteOnly()
从接口复制的说明:RepeatContext
Public accessor for the complete flag.- 指定者:
isCompleteOnly
在接口中RepeatContext
- 返回:
- indicator if the repeat is complete
setCompleteOnly
public void setCompleteOnly()
从接口复制的说明:RepeatContext
Signal to the framework that the current batch should complete normally, independent of the currentCompletionPolicy
.- 指定者:
setCompleteOnly
在接口中RepeatContext
isTerminateOnly
public boolean isTerminateOnly()
从接口复制的说明:RepeatContext
Public accessor for the termination flag. If this flag is set then the complete flag will also be.- 指定者:
isTerminateOnly
在接口中RepeatContext
- 返回:
- indicates if the repeat should terminate
setTerminateOnly
public void setTerminateOnly()
从接口复制的说明:RepeatContext
Signal to the framework that the current batch should complete abnormally, independent of the currentCompletionPolicy
.- 指定者:
setTerminateOnly
在接口中RepeatContext
getParent
public RepeatContext getParent()
从接口复制的说明:RepeatContext
If batches are nested, then the inner batch will be created with the outer one as a parent. This is an accessor for the parent if it exists.- 指定者:
getParent
在接口中RepeatContext
- 返回:
- the parent context or null if there is none
increment
public void increment()
Used by clients to increment the started count.
getStartedCount
public int getStartedCount()
从接口复制的说明:RepeatContext
Public access to a counter for the number of operations attempted.- 指定者:
getStartedCount
在接口中RepeatContext
- 返回:
- the number of batch operations started.
registerDestructionCallback
public void registerDestructionCallback(java.lang.String name, java.lang.Runnable callback)
从接口复制的说明:RepeatContext
Register a callback to be executed on close, associated with the attribute having the given name. TheRunnable
callback should not throw any exceptions.- 指定者:
registerDestructionCallback
在接口中RepeatContext
- 参数:
name
- the name of the attribute to associated this callback with. If this attribute is removed the callback should never be called.callback
- aRunnable
to execute when the context is closed.
close
public void close()
从接口复制的说明:RepeatContext
Allow resources to be cleared, especially in destruction callbacks. Implementations should ensure that any registered destruction callbacks are executed here, as long as the corresponding attribute is still available.- 指定者:
close
在接口中RepeatContext