Example usage for org.springframework.web.context.request DestructionCallbackBindingListener DestructionCallbackBindingListener

List of usage examples for org.springframework.web.context.request DestructionCallbackBindingListener DestructionCallbackBindingListener

Introduction

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

Prototype

public DestructionCallbackBindingListener(Runnable destructionCallback) 

Source Link

Document

Create a new DestructionCallbackBindingListener for the given callback.

Usage

From source file:org.springframework.web.context.request.ServletRequestAttributes.java

/**
 * Register the given callback as to be executed after session termination.
 * @param name the name of the attribute to register the callback for
 * @param callback the callback to be executed for destruction
 *///from   w  w  w . ja  v a 2 s.  com
private void registerSessionDestructionCallback(String name, Runnable callback) {
    HttpSession session = getSession(true);
    session.setAttribute(DESTRUCTION_CALLBACK_NAME_PREFIX + name,
            new DestructionCallbackBindingListener(callback));
}