本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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()));
}
示例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);
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}