Example usage for org.springframework.security.core.context SecurityContextHolder MODE_INHERITABLETHREADLOCAL

List of usage examples for org.springframework.security.core.context SecurityContextHolder MODE_INHERITABLETHREADLOCAL

Introduction

In this page you can find the example usage for org.springframework.security.core.context SecurityContextHolder MODE_INHERITABLETHREADLOCAL.

Prototype

String MODE_INHERITABLETHREADLOCAL

To view the source code for org.springframework.security.core.context SecurityContextHolder MODE_INHERITABLETHREADLOCAL.

Click Source Link

Usage

From source file:co.paralleluniverse.springframework.security.config.FiberSecurityContextHolderConfig.java

public FiberSecurityContextHolderConfig() {
    SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
}

From source file:org.vaadin.spring.security.internal.SecurityContextVaadinRequestListener.java

public SecurityContextVaadinRequestListener() {
    logger.info("Initializing {}, setting SecurityContextHolder strategy to {}", getClass().getSimpleName(),
            SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
    SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
}

From source file:br.com.hyperclass.snackbar.config.SecurityConfiguration.java

@Bean
public MethodInvokingFactoryBean methodInvokingFactoryBean() {
    final MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
    methodInvokingFactoryBean.setTargetClass(SecurityContextHolder.class);
    methodInvokingFactoryBean.setTargetMethod("setStrategyName");
    methodInvokingFactoryBean.setArguments(new Object[] { SecurityContextHolder.MODE_INHERITABLETHREADLOCAL });
    return methodInvokingFactoryBean;
}

From source file:ubc.pavlab.aspiredb.server.BaseSpringContextTest.java

/**
 * @throws Exception/*from   ww  w  .j av  a 2s.  co m*/
 */
@Override
final public void afterPropertiesSet() throws Exception {
    SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
    hibernateSupport.setSessionFactory(this.getBean(SessionFactory.class));

    this.authenticationTestingUtil = new AuthenticationTestingUtil();
    this.authenticationTestingUtil.setUserManager(this.getBean(UserManager.class));

    runAsAdmin();
}

From source file:ubic.gemma.core.util.test.BaseSpringContextTest.java

@Override
final public void afterPropertiesSet() {
    SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
    hibernateSupport.setSessionFactory(this.getBean(SessionFactory.class));

    this.authenticationTestingUtil = new AuthenticationTestingUtil();
    this.authenticationTestingUtil.setUserManager(this.getBean(UserManager.class));

    this.runAsAdmin();

}

From source file:ubic.gemma.testing.BaseSpringContextTest.java

/**
 * @throws Exception/*from  ww  w . j  a  v a2 s  .  c  om*/
 */
@Override
final public void afterPropertiesSet() throws Exception {
    SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
    hibernateSupport.setSessionFactory(this.getBean(SessionFactory.class));

    CompassUtils.deleteCompassLocks();

    this.authenticationTestingUtil = new AuthenticationTestingUtil();
    this.authenticationTestingUtil.setUserManager(this.getBean(UserManager.class));

    runAsAdmin();

}

From source file:ubic.gemma.web.listener.StartupListener.java

@Override
public void contextInitialized(ServletContextEvent event) {
    StartupListener.log.info("Initializing Gemma web context ...");
    StopWatch sw = new StopWatch();
    sw.start();//from ww w .  j  a  v a2 s . c om

    // call Spring's context ContextLoaderListener to initialize
    // all the context files specified in web.xml
    super.contextInitialized(event);

    ServletContext servletContext = event.getServletContext();

    Map<String, Object> config = this.initializeConfiguration(servletContext);

    this.loadTheme(servletContext, config);

    this.loadVersionInformation(config);

    this.loadTrackerInformation(config);

    ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);

    SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);

    servletContext.setAttribute(Constants.CONFIG, config);

    this.initializeHomologene(ctx);

    this.configureScheduler(ctx);

    sw.stop();

    double time = sw.getTime() / 1000.00;
    StartupListener.log.info("Initialization of Gemma Spring web context in " + time + " s ");
}