Java Code Examples for org.springframework.beans.factory.config.BeanDefinition#ROLE_INFRASTRUCTURE
The following examples show how to use
org.springframework.beans.factory.config.BeanDefinition#ROLE_INFRASTRUCTURE .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: lams File: ProxyCachingConfiguration.java License: GNU General Public License v2.0 | 6 votes |
@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; }
Example 2
Source Project: spring4-understanding File: AbstractJCacheConfiguration.java License: Apache License 2.0 | 6 votes |
@Bean(name = "jCacheOperationSource") @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public JCacheOperationSource cacheOperationSource() { DefaultJCacheOperationSource source = new DefaultJCacheOperationSource(); if (this.cacheManager != null) { source.setCacheManager(this.cacheManager); } if (this.keyGenerator != null) { source.setKeyGenerator(this.keyGenerator); } if (this.cacheResolver != null) { source.setCacheResolver(this.cacheResolver); } if (this.exceptionCacheResolver != null) { source.setExceptionCacheResolver(this.exceptionCacheResolver); } return source; }
Example 3
Source Project: lams File: ProxyCachingConfiguration.java License: GNU General Public License v2.0 | 5 votes |
@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; }
Example 4
Source Project: opentracing-toolbox File: OpenTracingJdbcAutoConfiguration.java License: MIT License | 5 votes |
@API(status = INTERNAL) @Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) @ConditionalOnProperty(name = "opentracing.jdbc.enabled", havingValue = "true", matchIfMissing = true) public static BeanPostProcessor tracingDataSourceBeanPostProcessor(final BeanFactory beanFactory) { return new TracingProcessor(beanFactory); }
Example 5
Source Project: lams File: MBeanExportConfiguration.java License: GNU General Public License v2.0 | 5 votes |
@Bean(name = MBEAN_EXPORTER_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public AnnotationMBeanExporter mbeanExporter() { AnnotationMBeanExporter exporter = new AnnotationMBeanExporter(); setupDomain(exporter); setupServer(exporter); setupRegistrationPolicy(exporter); return exporter; }
Example 6
Source Project: Limiter File: ProxyLimiterConfiguration.java License: Apache License 2.0 | 5 votes |
@Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public LimiterInterceptor limiterInterceptor() { LimiterInterceptor interceptor = new LimiterInterceptor(); interceptor.setLimitedResourceSource(limitedResourceSource()); return interceptor; }
Example 7
Source Project: spring-analysis-note File: ProxyTransactionManagementConfiguration.java License: MIT License | 5 votes |
@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; }
Example 8
Source Project: spring4-understanding File: ProxyJCacheConfiguration.java License: Apache License 2.0 | 5 votes |
@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; }
Example 9
Source Project: java-technology-stack File: MBeanExportConfiguration.java License: MIT License | 5 votes |
@Bean(name = MBEAN_EXPORTER_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public AnnotationMBeanExporter mbeanExporter() { AnnotationMBeanExporter exporter = new AnnotationMBeanExporter(); Assert.state(this.enableMBeanExport != null, "No EnableMBeanExport annotation found"); setupDomain(exporter, this.enableMBeanExport); setupServer(exporter, this.enableMBeanExport); setupRegistrationPolicy(exporter, this.enableMBeanExport); return exporter; }
Example 10
Source Project: java-technology-stack File: ProxyAsyncConfiguration.java License: MIT License | 5 votes |
@Bean(name = TaskManagementConfigUtils.ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public AsyncAnnotationBeanPostProcessor asyncAdvisor() { Assert.notNull(this.enableAsync, "@EnableAsync annotation metadata was not injected"); AsyncAnnotationBeanPostProcessor bpp = new AsyncAnnotationBeanPostProcessor(); bpp.configure(this.executor, this.exceptionHandler); Class<? extends Annotation> customAsyncAnnotation = this.enableAsync.getClass("annotation"); if (customAsyncAnnotation != AnnotationUtils.getDefaultValue(EnableAsync.class, "annotation")) { bpp.setAsyncAnnotationType(customAsyncAnnotation); } bpp.setProxyTargetClass(this.enableAsync.getBoolean("proxyTargetClass")); bpp.setOrder(this.enableAsync.<Integer>getNumber("order")); return bpp; }
Example 11
Source Project: jetcache File: JetCacheProxyConfiguration.java License: Apache License 2.0 | 5 votes |
@Bean(name = CacheAdvisor.CACHE_ADVISOR_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public CacheAdvisor jetcacheAdvisor(JetCacheInterceptor jetCacheInterceptor) { CacheAdvisor advisor = new CacheAdvisor(); advisor.setAdviceBeanName(CacheAdvisor.CACHE_ADVISOR_BEAN_NAME); advisor.setAdvice(jetCacheInterceptor); advisor.setBasePackages(this.enableMethodCache.getStringArray("basePackages")); advisor.setOrder(this.enableMethodCache.<Integer>getNumber("order")); return advisor; }
Example 12
Source Project: spring-boot-graal-feature File: SampleTransactionManagementConfiguration.java License: Apache License 2.0 | 4 votes |
@Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public TransactionAttributeSource transactionAttributeSource() { return new AnnotationTransactionAttributeSource(); }
Example 13
Source Project: spring-analysis-note File: AbstractTransactionManagementConfiguration.java License: MIT License | 4 votes |
@Bean(name = TransactionManagementConfigUtils.TRANSACTIONAL_EVENT_LISTENER_FACTORY_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public static TransactionalEventListenerFactory transactionalEventListenerFactory() { return new TransactionalEventListenerFactory(); }
Example 14
Source Project: spring-boot-graal-feature File: SampleTransactionManagementConfiguration.java License: Apache License 2.0 | 4 votes |
@Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public TransactionAttributeSource transactionAttributeSource() { return new AnnotationTransactionAttributeSource(); }
Example 15
Source Project: lams File: ProxyCachingConfiguration.java License: GNU General Public License v2.0 | 4 votes |
@Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public CacheOperationSource cacheOperationSource() { return new AnnotationCacheOperationSource(); }
Example 16
Source Project: spring4-understanding File: RoleAndDescriptionAnnotationTests.java License: Apache License 2.0 | 4 votes |
@Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) @Description("A Bean method with a role") public String bar() { return "bar"; }
Example 17
Source Project: spring-cloud-sleuth File: SleuthAnnotationAutoConfiguration.java License: Apache License 2.0 | 4 votes |
@Bean @Role(BeanDefinition.ROLE_INFRASTRUCTURE) @ConditionalOnClass(name = "reactor.core.publisher.Flux") SleuthMethodInvocationProcessor reactorSleuthMethodInvocationProcessor() { return new ReactorSleuthMethodInvocationProcessor(); }
Example 18
Source Project: spring4-understanding File: AbstractTransactionManagementConfiguration.java License: Apache License 2.0 | 4 votes |
@Bean(name = TransactionManagementConfigUtils.TRANSACTIONAL_EVENT_LISTENER_FACTORY_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public TransactionalEventListenerFactory transactionalEventListenerFactory() { return new TransactionalEventListenerFactory(); }
Example 19
Source Project: spring4-understanding File: SpringConfiguredConfiguration.java License: Apache License 2.0 | 4 votes |
@Bean(name = BEAN_CONFIGURER_ASPECT_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public AnnotationBeanConfigurerAspect beanConfigurerAspect() { return AnnotationBeanConfigurerAspect.aspectOf(); }
Example 20
Source Project: java-technology-stack File: InfrastructureAdvisorAutoProxyCreator.java License: MIT License | 4 votes |
@Override protected boolean isEligibleAdvisorBean(String beanName) { return (this.beanFactory != null && this.beanFactory.containsBeanDefinition(beanName) && this.beanFactory.getBeanDefinition(beanName).getRole() == BeanDefinition.ROLE_INFRASTRUCTURE); }