Example usage for org.springframework.context.annotation ScopedProxyMode TARGET_CLASS

List of usage examples for org.springframework.context.annotation ScopedProxyMode TARGET_CLASS

Introduction

In this page you can find the example usage for org.springframework.context.annotation ScopedProxyMode TARGET_CLASS.

Prototype

ScopedProxyMode TARGET_CLASS

To view the source code for org.springframework.context.annotation ScopedProxyMode TARGET_CLASS.

Click Source Link

Document

Create a class-based proxy (uses CGLIB).

Usage

From source file:com.xumpy.security.root.AppConfig.java

@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public UserInfo userInfo() {
    return new UserInfo();
}

From source file:com.orange.clara.cloud.servicedbdumper.config.UaaConfig.java

@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public OAuth2AccessToken getOAuth2AccessToken() {
    if (!(SecurityContextHolder.getContext().getAuthentication() instanceof OAuth2Authentication)) {
        return null;
    }/*  w  w  w. java2 s . c om*/
    OAuth2Authentication oAuth2Authentication = (OAuth2Authentication) SecurityContextHolder.getContext()
            .getAuthentication();
    final OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) oAuth2Authentication.getDetails();
    return new DefaultOAuth2AccessToken(details.getTokenValue());
}

From source file:com.orange.cepheus.cep.tenant.TenantConfiguration.java

@Bean
@Scope(value = "tenant", proxyMode = ScopedProxyMode.TARGET_CLASS)
ComplexEventProcessor complexEventProcessor() {
    return new EsperEventProcessor();
}

From source file:com.orange.clara.tool.config.OauthProviderConfig.java

@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public UsernamePasswordAuthenticationToken getOAuth2Authentication() {
    OAuth2Authentication oAuth2Authentication = (OAuth2Authentication) SecurityContextHolder.getContext()
            .getAuthentication();/* w  ww  .j  ava2s . c om*/
    return (UsernamePasswordAuthenticationToken) oAuth2Authentication.getUserAuthentication();
}

From source file:com.orange.cepheus.cep.tenant.TenantConfiguration.java

@Bean
@Scope(value = "tenant", proxyMode = ScopedProxyMode.TARGET_CLASS)
EventMapper eventMapper() {
    return new EventMapper();
}

From source file:com.github.mjeanroy.springmvc.uadetector.configuration.factories.UADetectorFactoriesConfiguration.java

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public ReadableUserAgentFactoryBean readableUserAgentFactoryBean() {
    return new ReadableUserAgentFactoryBean();
}

From source file:com.orange.cepheus.cep.tenant.TenantConfiguration.java

@Bean
@Scope(value = "tenant", proxyMode = ScopedProxyMode.TARGET_CLASS)
EventSinkListener eventSinkListener() {
    return new EventSinkListener();
}

From source file:com.orange.clara.cloud.services.sandbox.ElpaasoSandboxServiceApplication.java

@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public OAuth2AccessToken getOAuth2AccessToken() {
    OAuth2Authentication oAuth2Authentication = (OAuth2Authentication) SecurityContextHolder.getContext()
            .getAuthentication();//from   ww w  .j a va  2 s . c  om
    final OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) oAuth2Authentication.getDetails();
    return new DefaultOAuth2AccessToken(details.getTokenValue());
}

From source file:com.orange.clara.cloud.servicedbdumper.config.UaaConfig.java

@Bean(name = "cloudFoundryClientAsUser")
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public CloudFoundryClient getCloudFoundryClientAsUser() throws MalformedURLException {
    LOGGER.debug("Creating new CloudFoundry client using access token");
    OAuth2AccessToken oAuth2AccessToken = getOAuth2AccessToken();
    if (oAuth2AccessToken == null) {
        return null;
    }/*from w w w  .j  a va 2  s  .  c o  m*/
    return cloudFoundryClientFactory.createCloudFoundryClient(oAuth2AccessToken, this.cloudControllerUrl);
}

From source file:com.github.mjeanroy.springmvc.uadetector.configuration.factories.UADetectorFactoriesConfiguration.java

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public BrowserFactoryBean browserFactoryBean() {
    return new BrowserFactoryBean();
}