Search in sources :

Example 1 with BeanFactoryTransactionAttributeSourceAdvisor

use of cn.taketoday.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor in project today-framework by TAKETODAY.

the class ProxyTransactionManagementConfiguration method transactionAdvisor.

@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Component(TransactionManagementConfigUtils.TRANSACTION_ADVISOR_BEAN_NAME)
public BeanFactoryTransactionAttributeSourceAdvisor transactionAdvisor(TransactionAttributeSource transactionAttributeSource, TransactionInterceptor transactionInterceptor) {
    BeanFactoryTransactionAttributeSourceAdvisor advisor = new BeanFactoryTransactionAttributeSourceAdvisor();
    advisor.setTransactionAttributeSource(transactionAttributeSource);
    advisor.setAdvice(transactionInterceptor);
    if (this.enableTx != null) {
        advisor.setOrder(this.enableTx.getInt("order"));
    }
    return advisor;
}
Also used : BeanFactoryTransactionAttributeSourceAdvisor(cn.taketoday.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor) Role(cn.taketoday.context.annotation.Role) Component(cn.taketoday.lang.Component)

Example 2 with BeanFactoryTransactionAttributeSourceAdvisor

use of cn.taketoday.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor in project today-infrastructure by TAKETODAY.

the class ProxyTransactionManagementConfiguration method transactionAdvisor.

@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Component(TransactionManagementConfigUtils.TRANSACTION_ADVISOR_BEAN_NAME)
public BeanFactoryTransactionAttributeSourceAdvisor transactionAdvisor(TransactionAttributeSource transactionAttributeSource, TransactionInterceptor transactionInterceptor) {
    BeanFactoryTransactionAttributeSourceAdvisor advisor = new BeanFactoryTransactionAttributeSourceAdvisor();
    advisor.setTransactionAttributeSource(transactionAttributeSource);
    advisor.setAdvice(transactionInterceptor);
    if (this.enableTx != null) {
        advisor.setOrder(this.enableTx.getInt("order"));
    }
    return advisor;
}
Also used : BeanFactoryTransactionAttributeSourceAdvisor(cn.taketoday.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor) Role(cn.taketoday.context.annotation.Role) Component(cn.taketoday.lang.Component)

Aggregations

Role (cn.taketoday.context.annotation.Role)2 Component (cn.taketoday.lang.Component)2 BeanFactoryTransactionAttributeSourceAdvisor (cn.taketoday.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor)2