Search in sources :

Example 11 with Role

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

the class ValidationAutoConfiguration method jsr303Validator.

@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConditionalOnMissingBean
public static Validator jsr303Validator() {
    LocalValidatorFactoryBean factoryBean = new LocalValidatorFactoryBean();
    MessageInterpolatorFactory interpolatorFactory = new MessageInterpolatorFactory();
    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 12 with Role

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

the class ProxyJCacheConfiguration method cacheAdvisor.

@Bean(name = CacheManagementConfigUtils.JCACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryJCacheOperationSourceAdvisor cacheAdvisor() {
    BeanFactoryJCacheOperationSourceAdvisor advisor = new BeanFactoryJCacheOperationSourceAdvisor();
    advisor.setCacheOperationSource(cacheOperationSource());
    advisor.setAdvice(cacheInterceptor());
    advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
    return advisor;
}
Also used : BeanFactoryJCacheOperationSourceAdvisor(org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor) Role(org.springframework.context.annotation.Role) Bean(org.springframework.context.annotation.Bean)

Example 13 with Role

use of org.springframework.context.annotation.Role in project jetcache by alibaba.

the class JetCacheProxyConfiguration method jetcacheAdvisor.

@Bean(name = CacheAdvisor.CACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public CacheAdvisor jetcacheAdvisor() {
    ConcurrentHashMap configMap = new ConcurrentHashMap();
    JetCacheInterceptor jetCacheInterceptor = new JetCacheInterceptor();
    jetCacheInterceptor.setCacheConfigMap(configMap);
    jetCacheInterceptor.setApplicationContext(applicationContext);
    CacheAdvisor advisor = new CacheAdvisor();
    advisor.setAdviceBeanName(CacheAdvisor.CACHE_ADVISOR_BEAN_NAME);
    advisor.setAdvice(jetCacheInterceptor);
    advisor.setBasePackages(this.enableMethodCache.getStringArray("basePackages"));
    advisor.setCacheConfigMap(configMap);
    advisor.setOrder(this.enableMethodCache.<Integer>getNumber("order"));
    return advisor;
}
Also used : CacheAdvisor(com.alicp.jetcache.anno.aop.CacheAdvisor) JetCacheInterceptor(com.alicp.jetcache.anno.aop.JetCacheInterceptor) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Role(org.springframework.context.annotation.Role) Bean(org.springframework.context.annotation.Bean)

Example 14 with Role

use of org.springframework.context.annotation.Role in project warn-report by saaavsaaa.

the class CachingDBConfiguration method cacheAdvisor.

@Bean(name = CacheManagementConfigUtils.CACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryCacheOperationSourceAdvisor cacheAdvisor() {
    BeanFactoryCacheOperationSourceAdvisor advisor = new BeanFactoryCacheOperationSourceAdvisor();
    advisor.setCacheOperationSource(cacheOperationSource());
    advisor.setAdvice(cacheInterceptor());
    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 15 with Role

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

the class IntegrationMBeanExportConfiguration method mbeanExporter.

@Bean(name = MBEAN_EXPORTER_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public IntegrationMBeanExporter mbeanExporter() {
    IntegrationMBeanExporter exporter = new IntegrationMBeanExporter();
    exporter.setRegistrationPolicy(this.attributes.getEnum("registration"));
    setupDomain(exporter);
    setupServer(exporter);
    setupComponentNamePatterns(exporter);
    if (this.configurer != null) {
        if (this.configurer.getDefaultCountsEnabled() == null) {
            this.configurer.setDefaultCountsEnabled(true);
        }
        if (this.configurer.getDefaultStatsEnabled() == null) {
            this.configurer.setDefaultStatsEnabled(true);
        }
    }
    return exporter;
}
Also used : IntegrationMBeanExporter(org.springframework.integration.monitor.IntegrationMBeanExporter) 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