Example usage for org.springframework.web.context.request RequestAttributes registerDestructionCallback

List of usage examples for org.springframework.web.context.request RequestAttributes registerDestructionCallback

Introduction

In this page you can find the example usage for org.springframework.web.context.request RequestAttributes registerDestructionCallback.

Prototype

void registerDestructionCallback(String name, Runnable callback, int scope);

Source Link

Document

Register a callback to be executed on destruction of the specified attribute in the given scope.

Usage

From source file:uk.ac.ebi.intact.editor.util.HybridSessionThreadScope.java

public void registerDestructionCallback(String name, Runnable callback) {
    if (RequestContextHolder.getRequestAttributes() != null) {
        RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
        attributes.registerDestructionCallback(name, callback, RequestAttributes.SCOPE_SESSION);
    }/*from   w w  w .  j a va 2 s .  c  o m*/
}