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

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

Introduction

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

Prototype

ScopedProxyMode INTERFACES

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

Click Source Link

Document

Create a JDK dynamic proxy implementing all interfaces exposed by the class of the target object.

Usage

From source file:org.vaadin.spring.config.VaadinConfiguration.java

@Bean
@Scope(value = VaadinUIScope.VAADIN_UI_SCOPE_NAME, proxyMode = ScopedProxyMode.INTERFACES)
@EventBusScope(value = EventScope.UI, proxy = true)
EventBus proxiedUiEventBus() {
    return uiEventBus();
}

From source file:de.pksoftware.springstrap.core.config.FacebookLoginConfigBase.java

@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.INTERFACES)
public OAuth2RestOperations facebookOAuth2RestTemplate() {
    return new OAuth2RestTemplate(facebookOAuth2DetailsBean(),
            new DefaultOAuth2ClientContext(accessTokenRequest));
}

From source file:de.pksoftware.springstrap.core.config.GoogleLoginConfigBase.java

@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.INTERFACES)
public OAuth2RestOperations googleOAuth2RestTemplate(OAuth2ClientContext oAuth2ClientContext) {

    return new OAuth2RestTemplate(googleOAuth2DetailsBean(),
            new DefaultOAuth2ClientContext(accessTokenRequest));
}

From source file:com.solxiom.social.config.ExplicitSocialConfig.java

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public ConnectionRepository connectionRepository() {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if (authentication == null) {
        throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
    }/*from ww w  .  jav a2 s  .  co m*/
    return usersConnectionRepository().createConnectionRepository(authentication.getName());
}

From source file:com.pramati.knowyou.config.SocialConfig.java

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Yammer yammer() {
    Connection<Yammer> yammer = connectionRepository().findPrimaryConnection(Yammer.class);
    return yammer != null ? yammer.getApi() : null;
}

From source file:com.folion.config.SocialConfiguration.java

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Facebook facebook(ConnectionRepository repository) {
    Connection<Facebook> connection = repository.findPrimaryConnection(Facebook.class);
    return connection != null ? connection.getApi() : null;
}

From source file:domain.user.social.SocialConfig.java

@Bean
@Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES)
public UsersConnectionRepository usersConnectionRepository() {
    JdbcUsersConnectionRepository repository = new JdbcUsersConnectionRepository(dataSource,
            connectionFactoryLocator(), textEncryptor());
    return repository;
}

From source file:com.springsource.greenhouse.config.SocialConfig.java

/**
 * The locator for SaaS provider connection factories.
 * When support for a new provider is added to Greenhouse, simply register the corresponding {@link ConnectionFactory} here.
 * The current Environment is used to lookup the credentials assigned to the Greenhouse application by each provider during application registration.
 * This bean is defined as a scoped-proxy so it can be serialized in support of {@link ProviderSignInAttempt provier sign-in attempts}.
 *//*from   w w  w.  ja  v  a  2 s . com*/
@Bean
@Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES)
public ConnectionFactoryLocator connectionFactoryLocator() {
    ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();
    registry.addConnectionFactory(new TwitterConnectionFactory(environment.getProperty("twitter.consumerKey"),
            environment.getProperty("twitter.consumerSecret")));
    registry.addConnectionFactory(new FacebookConnectionFactory(environment.getProperty("facebook.appId"),
            environment.getProperty("facebook.appSecret")));
    registry.addConnectionFactory(new LinkedInConnectionFactory(environment.getProperty("linkedin.consumerKey"),
            environment.getProperty("linkedin.consumerSecret")));
    registry.addConnectionFactory(new TripItConnectionFactory(environment.getProperty("tripit.consumerKey"),
            environment.getProperty("tripit.consumerSecret")));
    return registry;
}

From source file:com.social.google.dssm2015.config.SocialConfig.java

/**
 * A proxy to a request-scoped object representing the current user's primary Facebook account.
 * /*from www  .jav a2 s  . co  m*/
 * @throws NotConnectedException if the user is not connected to facebook.
 */
@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Google google() {
    return connectionRepository().getPrimaryConnection(Google.class).getApi();
}

From source file:com.cloudfoundry.samples.spring.config.SocialConfig.java

/**
 * A proxy to a request-scoped object representing the current user's primary Facebook account.
 * @throws NotConnectedException if the user is not connected to facebook.
 *///w  ww.  ja  v  a  2 s.  com
@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Facebook facebook() {
    return connectionRepository().getPrimaryConnection(Facebook.class).getApi();
}