Example usage for org.springframework.web.reactive.result.method.annotation SessionAttributesHandler SessionAttributesHandler

List of usage examples for org.springframework.web.reactive.result.method.annotation SessionAttributesHandler SessionAttributesHandler

Introduction

In this page you can find the example usage for org.springframework.web.reactive.result.method.annotation SessionAttributesHandler SessionAttributesHandler.

Prototype

public SessionAttributesHandler(Class<?> handlerType) 

Source Link

Document

Create a new session attributes handler.

Usage

From source file:org.springframework.web.reactive.result.method.annotation.ControllerMethodResolver.java

/**
 * Return the handler for the type-level {@code @SessionAttributes} annotation
 * based on the given controller method.
 *//*from   w ww  .j a  v  a  2  s .  com*/
public SessionAttributesHandler getSessionAttributesHandler(HandlerMethod handlerMethod) {
    Class<?> handlerType = handlerMethod.getBeanType();
    SessionAttributesHandler result = this.sessionAttributesHandlerCache.get(handlerType);
    if (result == null) {
        synchronized (this.sessionAttributesHandlerCache) {
            result = this.sessionAttributesHandlerCache.get(handlerType);
            if (result == null) {
                result = new SessionAttributesHandler(handlerType);
                this.sessionAttributesHandlerCache.put(handlerType, result);
            }
        }
    }
    return result;
}