本文整理汇总了Java中org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator类的典型用法代码示例。如果您正苦于以下问题:Java BeanNameAutoProxyCreator类的具体用法?Java BeanNameAutoProxyCreator怎么用?Java BeanNameAutoProxyCreator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BeanNameAutoProxyCreator类属于org.springframework.aop.framework.autoproxy包,在下文中一共展示了BeanNameAutoProxyCreator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: customizeTransactionBeanNameAutoProxyCreator
import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator; //导入依赖的package包/类
/**
* 配置事务拦截
* <p>
* {@link #customizeTransactionInterceptor(PlatformTransactionManager)}
*/
@Bean
public BeanNameAutoProxyCreator customizeTransactionBeanNameAutoProxyCreator () {
BeanNameAutoProxyCreator beanNameAutoProxyCreator = new BeanNameAutoProxyCreator();
// 设置定制的事务拦截器
beanNameAutoProxyCreator.setInterceptorNames( CUSTOMIZE_TRANSACTION_INTERCEPTOR_NAME );
List< String > transactionBeanNames = new ArrayList<>( DEFAULT_TRANSACTION_BEAN_NAMES.length + customizeTransactionBeanNames.length );
// 默认
transactionBeanNames.addAll( Arrays.asList( DEFAULT_TRANSACTION_BEAN_NAMES ) );
// 定制
transactionBeanNames.addAll( Arrays.asList( customizeTransactionBeanNames ) );
// 归集
for ( String transactionBeanName : transactionBeanNames ) {
beanNameAutoProxyCreator.setBeanNames( transactionBeanName );
}
beanNameAutoProxyCreator.setProxyTargetClass( true );
return beanNameAutoProxyCreator;
}
开发者ID:yujunhao8831,项目名称:spring-boot-start-current,代码行数:23,代码来源:TransactionalConfig.java
示例2: txProxy
import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator; //导入依赖的package包/类
@Bean
public BeanNameAutoProxyCreator txProxy(){
BeanNameAutoProxyCreator creator = new BeanNameAutoProxyCreator();
creator.setInterceptorNames("txAdvice");
creator.setBeanNames("*Service","*ServiceImpl");
creator.setProxyTargetClass(true);
return creator;
}
开发者ID:ranji1221,项目名称:lemcloud,代码行数:9,代码来源:TransactionConfig.java
示例3: nameProxyCreator
import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator; //导入依赖的package包/类
@Bean
@ConfigurationProperties(DruidStatProperties.DRUID_STAT_PREFIX)
public BeanNameAutoProxyCreator nameProxyCreator(DruidStatProperties properties){
if (properties.getBeanNames() == null){
throw new IllegalStateException(DruidStatProperties.DRUID_STAT_PREFIX+".bean-names must not null.");
}
BeanNameAutoProxyCreator creator = new BeanNameAutoProxyCreator();
creator.setProxyTargetClass(proxyTargetClass);
String[] beanNames = new String[properties.getBeanNames().size()];
beanNames = properties.getBeanNames().toArray(beanNames);
creator.setBeanNames(beanNames);
creator.setInterceptorNames(DruidStatProperties.DRUID_STAT_INTERCEPTOR_NAME);
return creator;
}
开发者ID:cuisongliu,项目名称:druid-boot-starter,代码行数:15,代码来源:DruidNameAopAutoConfiguration.java
示例4: taskExecutionStatusServiceProxyCreator
import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator; //导入依赖的package包/类
/**
* Creates a proxy for the task execution status service that logs method invocation on the service.
*
* @return Task execution status service proxy creator.
*/
@Bean
public BeanNameAutoProxyCreator taskExecutionStatusServiceProxyCreator() {
final BeanNameAutoProxyCreator theProxyCreator = new BeanNameAutoProxyCreator();
final String[] theProxiedBeanNames = new String[1];
theProxiedBeanNames[0] = "taskExecutionStatusService";
theProxyCreator.setBeanNames(theProxiedBeanNames);
final String[] theInterceptorNames = new String[1];
theInterceptorNames[0] = "invocationLoggerInterceptor";
theProxyCreator.setInterceptorNames(theInterceptorNames);
return theProxyCreator;
}
开发者ID:krizsan,项目名称:message-cowboy,代码行数:19,代码来源:TaskExecutionStatusCleanupTestConfiguration.java
示例5: lazyInitAutoProxyCreator
import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator; //导入依赖的package包/类
@Bean
public BeanNameAutoProxyCreator lazyInitAutoProxyCreator() {
BeanNameAutoProxyCreator autoProxyCreator = new BeanNameAutoProxyCreator();
autoProxyCreator.setCustomTargetSourceCreators(lazyInitTargetSourceCreator());
return autoProxyCreator;
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:AutoProxyLazyInitTests.java
注:本文中的org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论