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


Java Role类代码示例

本文整理汇总了Java中org.springframework.context.annotation.Role的典型用法代码示例。如果您正苦于以下问题:Java Role类的具体用法?Java Role怎么用?Java Role使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: asyncAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@Bean(name=AnnotationConfigUtils.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();
	Class<? extends Annotation> customAsyncAnnotation = enableAsync.getClass("annotation");
	if (customAsyncAnnotation != AnnotationUtils.getDefaultValue(EnableAsync.class, "annotation")) {
		bpp.setAsyncAnnotationType(customAsyncAnnotation);
	}
	if (this.executor != null) {
		bpp.setExecutor(this.executor);
	}
	bpp.setProxyTargetClass(this.enableAsync.getBoolean("proxyTargetClass"));
	bpp.setOrder(this.enableAsync.<Integer>getNumber("order"));
	return bpp;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:ProxyAsyncConfiguration.java

示例2: jetcacheAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@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;
}
 
开发者ID:alibaba,项目名称:jetcache,代码行数:18,代码来源:JetCacheProxyConfiguration.java

示例3: asyncAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@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();
	Class<? extends Annotation> customAsyncAnnotation = this.enableAsync.getClass("annotation");
	if (customAsyncAnnotation != AnnotationUtils.getDefaultValue(EnableAsync.class, "annotation")) {
		bpp.setAsyncAnnotationType(customAsyncAnnotation);
	}
	if (this.executor != null) {
		bpp.setExecutor(this.executor);
	}
	if (this.exceptionHandler != null) {
		bpp.setExceptionHandler(this.exceptionHandler);
	}
	bpp.setProxyTargetClass(this.enableAsync.getBoolean("proxyTargetClass"));
	bpp.setOrder(this.enableAsync.<Integer>getNumber("order"));
	return bpp;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:20,代码来源:ProxyAsyncConfiguration.java

示例4: cacheInterceptor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@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;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:20,代码来源:ProxyCachingConfiguration.java

示例5: cacheOperationSource

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@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;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:19,代码来源:AbstractJCacheConfiguration.java

示例6: packageTraceAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public Advisor packageTraceAdvisor() {
    ComposablePointcut resultPointcut = new ComposablePointcut();
    {
        List<String> basePackages = findBasePackages();
        String pointcutExpression = makeExpression(basePackages);
        AspectJExpressionPointcut packagePointcut = new AspectJExpressionPointcut();
        log.info("Include package Pointcut expression : {}", pointcutExpression);
        packagePointcut.setExpression(pointcutExpression);
        resultPointcut.intersection((Pointcut) packagePointcut);
    }

    String excludeAnnotation = buildExcludeAnnotation();
    log.info("Exclude Annotation Pointcut expression : {}", excludeAnnotation);

    AspectJExpressionPointcut basePointcut = new AspectJExpressionPointcut();
    basePointcut.setExpression(excludeAnnotation);
    resultPointcut.intersection((Pointcut) basePointcut);

    DefaultPointcutAdvisor pointcutAdvisor = new DefaultPointcutAdvisor(resultPointcut, new TraceAopInterceptor(traceLogManager));
    pointcutAdvisor.setOrder(Integer.MAX_VALUE);
    return pointcutAdvisor;
}
 
开发者ID:acupple,项目名称:stormv-spring-tracer,代码行数:25,代码来源:SimpleTraceConfiguration.java

示例7: lockInterceptor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public LockInterceptor lockInterceptor() {
   LockInterceptor interceptor = new LockInterceptor();
   interceptor.setLockAttributeSource(lockAttributeSource());

   AbstractLockSynchronizationManager synchronizationManager;
   if (enableLock.getBoolean("sessionTransacted")) {
      synchronizationManager = new SessionTransactedLockSynchronizationManager();
   } else {
      synchronizationManager = new DefaultLockSynchronizationManager();
   }
   synchronizationManager.setLockService(lockService);
   synchronizationManager.setLockEventPublisher(lockEventPublisher());
   interceptor.setSynchronizationManager(synchronizationManager);

   return interceptor;
}
 
开发者ID:My-easy-Solutions,项目名称:spring-lock,代码行数:19,代码来源:ProxyLockConfiguration.java

示例8: threadPoolTaskExecutor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@ConditionalOnProperty(prefix = "async.executor", name = "enabled", matchIfMissing = true)
@Bean(name = DEFAULT_TASK_EXECUTOR_BEAN_NAME, destroyMethod = "shutdown")
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public ThreadPoolTaskExecutor threadPoolTaskExecutor(AsyncExecutorProperties properties) {
    log.info("Creating ThreadPoolTaskExecutor 'taskExecutor' with core-size={} max-size={} queue-capacity={}",
            properties.getCorePoolSize(), properties.getMaxPoolSize(), properties.getQueueCapacity());

    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(properties.getCorePoolSize());
    executor.setMaxPoolSize(properties.getMaxPoolSize());

    executor.setQueueCapacity(properties.getQueueCapacity());
    executor.setThreadNamePrefix(properties.getThreadNamePrefix());
    executor.setAwaitTerminationSeconds(properties.getAwaitTerminationSeconds());

    executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardOldestPolicy());

    executor.afterPropertiesSet();
    return executor;
}
 
开发者ID:zalando-stups,项目名称:booties,代码行数:21,代码来源:AsyncExecutorConfiguration.java

示例9: cacheInterceptor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public CacheInterceptor cacheInterceptor() {
	CacheInterceptor interceptor = new CacheInterceptor();
	interceptor.setCacheOperationSources(cacheOperationSource());
	if (this.cacheManager != null) {
		interceptor.setCacheManager(this.cacheManager);
	}
	if (this.keyGenerator != null) {
		interceptor.setKeyGenerator(this.keyGenerator);
	}
	return interceptor;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:14,代码来源:ProxyCachingConfiguration.java

示例10: transactionAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@Bean(name=TransactionManagementConfigUtils.TRANSACTION_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryTransactionAttributeSourceAdvisor transactionAdvisor() {
	BeanFactoryTransactionAttributeSourceAdvisor advisor = new BeanFactoryTransactionAttributeSourceAdvisor();
	advisor.setTransactionAttributeSource(transactionAttributeSource());
	advisor.setAdvice(transactionInterceptor());
	advisor.setOrder(this.enableTx.<Integer>getNumber("order"));
	return advisor;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:ProxyTransactionManagementConfiguration.java

示例11: transactionInterceptor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ProxyTransactionManagementConfiguration.java

示例12: cacheAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@Bean(name=AnnotationConfigUtils.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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ProxyCachingConfiguration.java

示例13: cacheAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@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;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:ProxyCachingConfiguration.java

示例14: transactionAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@Bean(name = TransactionManagementConfigUtils.TRANSACTION_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryTransactionAttributeSourceAdvisor transactionAdvisor() {
	BeanFactoryTransactionAttributeSourceAdvisor advisor = new BeanFactoryTransactionAttributeSourceAdvisor();
	advisor.setTransactionAttributeSource(transactionAttributeSource());
	advisor.setAdvice(transactionInterceptor());
	advisor.setOrder(this.enableTx.<Integer>getNumber("order"));
	return advisor;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:ProxyTransactionManagementConfiguration.java

示例15: cacheAdvisor

import org.springframework.context.annotation.Role; //导入依赖的package包/类
@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;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:ProxyJCacheConfiguration.java


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