Search in sources :

Example 6 with Role

use of org.springframework.context.annotation.Role in project spring-boot by spring-projects.

the class ValidationAutoConfiguration method defaultValidator.

@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConditionalOnMissingBean(Validator.class)
public static LocalValidatorFactoryBean defaultValidator(ApplicationContext applicationContext) {
    LocalValidatorFactoryBean factoryBean = new LocalValidatorFactoryBean();
    MessageInterpolatorFactory interpolatorFactory = new MessageInterpolatorFactory(applicationContext);
    factoryBean.setMessageInterpolator(interpolatorFactory.getObject());
    return factoryBean;
}
Also used : LocalValidatorFactoryBean(org.springframework.validation.beanvalidation.LocalValidatorFactoryBean) MessageInterpolatorFactory(org.springframework.boot.validation.MessageInterpolatorFactory) Role(org.springframework.context.annotation.Role) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean) LocalValidatorFactoryBean(org.springframework.validation.beanvalidation.LocalValidatorFactoryBean)

Example 7 with Role

use of org.springframework.context.annotation.Role in project spring-framework by spring-projects.

the class ProxyCachingConfiguration method cacheAdvisor.

@Bean(name = CacheManagementConfigUtils.CACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryCacheOperationSourceAdvisor cacheAdvisor(CacheOperationSource cacheOperationSource, CacheInterceptor cacheInterceptor) {
    BeanFactoryCacheOperationSourceAdvisor advisor = new BeanFactoryCacheOperationSourceAdvisor();
    advisor.setCacheOperationSource(cacheOperationSource);
    advisor.setAdvice(cacheInterceptor);
    if (this.enableCaching != null) {
        advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
    }
    return advisor;
}
Also used : BeanFactoryCacheOperationSourceAdvisor(org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor) Role(org.springframework.context.annotation.Role) Bean(org.springframework.context.annotation.Bean)

Example 8 with Role

use of org.springframework.context.annotation.Role in project spring-framework by spring-projects.

the class ProxyCachingConfiguration method cacheInterceptor.

@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public CacheInterceptor cacheInterceptor(CacheOperationSource cacheOperationSource) {
    CacheInterceptor interceptor = new CacheInterceptor();
    interceptor.configure(this.errorHandler, this.keyGenerator, this.cacheResolver, this.cacheManager);
    interceptor.setCacheOperationSource(cacheOperationSource);
    return interceptor;
}
Also used : CacheInterceptor(org.springframework.cache.interceptor.CacheInterceptor) Role(org.springframework.context.annotation.Role) Bean(org.springframework.context.annotation.Bean)

Example 9 with Role

use of org.springframework.context.annotation.Role in project spring-framework by spring-projects.

the class ProxyCachingConfiguration method cacheInterceptor.

@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public CacheInterceptor cacheInterceptor() {
    CacheInterceptor interceptor = new CacheInterceptor();
    interceptor.setCacheOperationSources(cacheOperationSource());
    if (this.cacheResolver != null) {
        interceptor.setCacheResolver(this.cacheResolver);
    } else if (this.cacheManager != null) {
        interceptor.setCacheManager(this.cacheManager);
    }
    if (this.keyGenerator != null) {
        interceptor.setKeyGenerator(this.keyGenerator);
    }
    if (this.errorHandler != null) {
        interceptor.setErrorHandler(this.errorHandler);
    }
    return interceptor;
}
Also used : CacheInterceptor(org.springframework.cache.interceptor.CacheInterceptor) Role(org.springframework.context.annotation.Role) Bean(org.springframework.context.annotation.Bean)

Example 10 with Role

use of org.springframework.context.annotation.Role in project spring-framework by spring-projects.

the class ProxyTransactionManagementConfiguration method transactionInterceptor.

@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public TransactionInterceptor transactionInterceptor() {
    TransactionInterceptor interceptor = new TransactionInterceptor();
    interceptor.setTransactionAttributeSource(transactionAttributeSource());
    if (this.txManager != null) {
        interceptor.setTransactionManager(this.txManager);
    }
    return interceptor;
}
Also used : TransactionInterceptor(org.springframework.transaction.interceptor.TransactionInterceptor) Role(org.springframework.context.annotation.Role) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)24 Role (org.springframework.context.annotation.Role)24 BeanFactoryCacheOperationSourceAdvisor (org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor)4 CacheInterceptor (org.springframework.cache.interceptor.CacheInterceptor)4 CacheAdvisor (com.alicp.jetcache.anno.aop.CacheAdvisor)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 MessageInterpolatorFactory (org.springframework.boot.validation.MessageInterpolatorFactory)2 BeanFactoryJCacheOperationSourceAdvisor (org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor)2 JCacheInterceptor (org.springframework.cache.jcache.interceptor.JCacheInterceptor)2 ExpressionBasedAnnotationAttributeFactory (org.springframework.security.access.expression.method.ExpressionBasedAnnotationAttributeFactory)2 DelegatingMethodSecurityMetadataSource (org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource)2 PrePostAnnotationSecurityMetadataSource (org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource)2 BeanFactoryTransactionAttributeSourceAdvisor (org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor)2 TransactionInterceptor (org.springframework.transaction.interceptor.TransactionInterceptor)2 LocalValidatorFactoryBean (org.springframework.validation.beanvalidation.LocalValidatorFactoryBean)2 JetCacheInterceptor (com.alicp.jetcache.anno.aop.JetCacheInterceptor)1 ArrayList (java.util.ArrayList)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 IntegrationMBeanExporter (org.springframework.integration.monitor.IntegrationMBeanExporter)1 Jsr250MethodSecurityMetadataSource (org.springframework.security.access.annotation.Jsr250MethodSecurityMetadataSource)1