Example usage for org.springframework.batch.core.scope.context StepContext registerDestructionCallback

List of usage examples for org.springframework.batch.core.scope.context StepContext registerDestructionCallback

Introduction

In this page you can find the example usage for org.springframework.batch.core.scope.context StepContext registerDestructionCallback.

Prototype

public void registerDestructionCallback(String name, Runnable callback) 

Source Link

Document

Allow clients to register callbacks for clean up on close.

Usage

From source file:org.springframework.batch.core.scope.StepScope.java

/**
 * @see Scope#registerDestructionCallback(String, Runnable)
 *///from  www  . j  a  va  2 s . c  om
@Override
public void registerDestructionCallback(String name, Runnable callback) {
    StepContext context = getContext();
    if (logger.isDebugEnabled()) {
        logger.debug(
                String.format("Registered destruction callback in scope=%s, name=%s", this.getName(), name));
    }
    context.registerDestructionCallback(name, callback);
}