接口 RepeatContext

    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型方法说明
      voidclose()
      Allow resources to be cleared, especially in destruction callbacks.
      RepeatContextgetParent()
      If batches are nested, then the inner batch will be created with the outer one as a parent.
      intgetStartedCount()
      Public access to a counter for the number of operations attempted.
      booleanisCompleteOnly()
      Public accessor for the complete flag.
      booleanisTerminateOnly()
      Public accessor for the termination flag.
      voidregisterDestructionCallback​(java.lang.String name, java.lang.Runnable callback)
      Register a callback to be executed on close, associated with the attribute having the given name.
      voidsetCompleteOnly()
      Signal to the framework that the current batch should complete normally, independent of the current CompletionPolicy.
      voidsetTerminateOnly()
      Signal to the framework that the current batch should complete abnormally, independent of the current CompletionPolicy.
      • 从接口继承的方法 org.springframework.core.AttributeAccessor

        attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute
    • 方法详细资料

      • getParent

        RepeatContext getParent()
        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.
        返回:
        the parent context or null if there is none
      • getStartedCount

        int getStartedCount()
        Public access to a counter for the number of operations attempted.
        返回:
        the number of batch operations started.
      • setCompleteOnly

        void setCompleteOnly()
        Signal to the framework that the current batch should complete normally, independent of the current CompletionPolicy.
      • isCompleteOnly

        boolean isCompleteOnly()
        Public accessor for the complete flag.
        返回:
        indicator if the repeat is complete
      • isTerminateOnly

        boolean isTerminateOnly()
        Public accessor for the termination flag. If this flag is set then the complete flag will also be.
        返回:
        indicates if the repeat should terminate
      • registerDestructionCallback

        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. The Runnable callback should not throw any exceptions.
        参数:
        name - the name of the attribute to associated this callback with. If this attribute is removed the callback should never be called.
        callback - a Runnable to execute when the context is closed.
      • close

        void close()
        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.