Example usage for org.springframework.web.servlet.mvc.method.annotation RequestMappingHandlerAdapter setSynchronizeOnSession

List of usage examples for org.springframework.web.servlet.mvc.method.annotation RequestMappingHandlerAdapter setSynchronizeOnSession

Introduction

In this page you can find the example usage for org.springframework.web.servlet.mvc.method.annotation RequestMappingHandlerAdapter setSynchronizeOnSession.

Prototype

public void setSynchronizeOnSession(boolean synchronizeOnSession) 

Source Link

Document

Set if controller execution should be synchronized on the session, to serialize parallel invocations from the same client.

Usage

From source file:com.example.session.app.config.EnableSynchronizeOnSessionPostProcessor.java

@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    if (bean instanceof RequestMappingHandlerAdapter) {
        RequestMappingHandlerAdapter adapter = (RequestMappingHandlerAdapter) bean;
        adapter.setSynchronizeOnSession(true); // (1)
    }/*from   w  w  w .  j ava2 s  .  co m*/
    return bean;
}