当前位置: 首页>>代码示例>>Java>>正文


Java ScopedProxyMode.INTERFACES属性代码示例

本文整理汇总了Java中org.springframework.context.annotation.ScopedProxyMode.INTERFACES属性的典型用法代码示例。如果您正苦于以下问题:Java ScopedProxyMode.INTERFACES属性的具体用法?Java ScopedProxyMode.INTERFACES怎么用?Java ScopedProxyMode.INTERFACES使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.springframework.context.annotation.ScopedProxyMode的用法示例。


在下文中一共展示了ScopedProxyMode.INTERFACES属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DefaultAccessTokenRequest

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public DefaultOAuth2ClientContext oauth2ClientContext() {
	DefaultOAuth2ClientContext context = new DefaultOAuth2ClientContext(
			new DefaultAccessTokenRequest());
	Authentication principal = SecurityContextHolder.getContext()
			.getAuthentication();
	if (principal instanceof OAuth2Authentication) {
		OAuth2Authentication authentication = (OAuth2Authentication) principal;
		Object details = authentication.getDetails();
		if (details instanceof OAuth2AuthenticationDetails) {
			OAuth2AuthenticationDetails oauthsDetails = (OAuth2AuthenticationDetails) details;
			String token = oauthsDetails.getTokenValue();
			context.setAccessToken(new DefaultOAuth2AccessToken(token));
		}
	}
	return context;
}
 
开发者ID:spring-projects,项目名称:spring-security-oauth2-boot,代码行数:18,代码来源:OAuth2RestOperationsConfiguration.java

示例2: facebook

@Bean
@ConditionalOnMissingBean(Facebook.class)
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Facebook facebook(ConnectionRepository repository) {
	Connection<Facebook> connection = repository
			.findPrimaryConnection(Facebook.class);
	return connection != null ? connection.getApi() : null;
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:8,代码来源:FacebookConfiguration.java

示例3: brokerService

@Bean
@Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES)
Service brokerService() {
    if (brokerService == null) {
        try {
            BrokerService broker = new BrokerService();
            broker.setPersistent(false);
            broker.getSystemUsage().getMemoryUsage().setLimit(10*1024*10);
            broker.start();
            brokerService = broker;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    return brokerService;
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:16,代码来源:AppConfig.java

示例4: google

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Google google(final ConnectionRepository repository) {
	final Connection<Google> connection = repository
			.findPrimaryConnection(Google.class);
	return connection != null ? connection.getApi() : null;
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:7,代码来源:GoogleConfigurerAdapter.java

示例5: gitHub

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public GitHub gitHub(ConnectionRepository repository) {
	Connection<GitHub> connection = repository
			.findPrimaryConnection(GitHub.class);
	return connection != null ? connection.getApi() : null;
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:7,代码来源:GitHubConfiguration.java

示例6: owlOntology

@Bean
@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.INTERFACES)
public OWLMutableOntology owlOntology(PrefixManager prefixManager) throws OWLOntologyCreationException {
  if (prefixManager.getDefaultPrefix() == null) {
    throw new IllegalStateException("Default ontology prefix must not be null.");
  }

  OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager();
  // Cast to a mutable ontology to pass OWLApi's strange checks
  return (OWLMutableOntology) ontologyManager.createOntology(IRI.create(prefixManager.getDefaultPrefix()));
}
 
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:11,代码来源:OwlApiConfig.java

示例7: vkontakte

@Bean
@ConditionalOnMissingBean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public VKontakte vkontakte(ConnectionRepository repository) {
    Connection<VKontakte> connection = repository.findPrimaryConnection(VKontakte.class);
    if (connection != null) {
        return connection.getApi();
    }
    return new VKontakteTemplate();
}
 
开发者ID:saladinkzn,项目名称:social-vkontakte-spring-boot-starter,代码行数:10,代码来源:VKontakteAutoConfiguration.java

示例8: twitter

@Bean
@ConditionalOnMissingBean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Twitter twitter(ConnectionRepository repository) {
	Connection<Twitter> connection = repository
			.findPrimaryConnection(Twitter.class);
	if (connection != null) {
		return connection.getApi();
	}
	return new TwitterTemplate(this.properties.getAppId(),
			this.properties.getAppSecret());
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:TwitterAutoConfiguration.java

示例9: linkedin

@Bean
@ConditionalOnMissingBean(LinkedIn.class)
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public LinkedIn linkedin(ConnectionRepository repository) {
	Connection<LinkedIn> connection = repository
			.findPrimaryConnection(LinkedIn.class);
	return connection != null ? connection.getApi() : null;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:LinkedInAutoConfiguration.java

示例10: wicketContextProvider

@Bean
/* Use a proxy to fix a circular dependency.
 * There's no real notion of scope here, since the bean is a singleton: we just want it to be proxyfied so that
 * the circular dependency is broken.
 */
@Scope(proxyMode = ScopedProxyMode.INTERFACES)
public IWicketContextProvider wicketContextProvider(WebApplication defaultApplication) {
	return new WicketContextProviderImpl(defaultApplication);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:9,代码来源:AbstractWebappConfig.java

示例11: connectionRepository

@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");
	}
	return usersConnectionRepository().createConnectionRepository(authentication.getName());
}
 
开发者ID:kevindeyne,项目名称:simple-facebook-integration-spring-sec,代码行数:9,代码来源:WebSecurityConfig.java

示例12: facebook

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Facebook facebook(ConnectionRepository repository) {
    log.debug("Connection from " + Facebook.class);
    Connection<Facebook> connection = repository.findPrimaryConnection(Facebook.class);
    return connection != null ? connection.getApi() : null;
}
 
开发者ID:esutoniagodesu,项目名称:egd-web,代码行数:7,代码来源:SocialConfig.java

示例13: google

@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Google google(ConnectionRepository repository) {
    log.debug("Connection from " + Google.class);
    Connection<Google> connection = repository.findPrimaryConnection(Google.class);
    return connection != null ? connection.getApi() : null;
}
 
开发者ID:esutoniagodesu,项目名称:egd-web,代码行数:7,代码来源:SocialConfig.java

示例14: executionDatabasePlatform

@Bean
@Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES)
public IDatabasePlatform executionDatabasePlatform() {
    if (executionDatabasePlatform == null) {
        executionDatabasePlatform = JdbcDatabasePlatformFactory.createNewPlatformInstance(executionDataSource(),
                new SqlTemplateSettings(), false, false);
    }
    return executionDatabasePlatform;
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:9,代码来源:AppConfig.java

示例15: configurationService

@Bean
@Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES)
public IConfigurationService configurationService() {
    if (configurationService == null) {
        configurationService = new AuditableConfigurationService(operationsService(), securityService(), configDatabasePlatform(),
                persistenceManager(), tablePrefix());
    }
    return configurationService;
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:9,代码来源:AppConfig.java


注:本文中的org.springframework.context.annotation.ScopedProxyMode.INTERFACES属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。