Example usage for org.springframework.transaction.interceptor MatchAlwaysTransactionAttributeSource MatchAlwaysTransactionAttributeSource

List of usage examples for org.springframework.transaction.interceptor MatchAlwaysTransactionAttributeSource MatchAlwaysTransactionAttributeSource

Introduction

In this page you can find the example usage for org.springframework.transaction.interceptor MatchAlwaysTransactionAttributeSource MatchAlwaysTransactionAttributeSource.

Prototype

MatchAlwaysTransactionAttributeSource

Source Link

Usage

From source file:org.jdal.service.PersistentServiceFactory.java

/**
 * Creates a default transactional proxy for service with default transacction attributes
 * @param <T>/*from   w w w.ja va 2s  .co  m*/
 * @param service
 * @return a Tx Proxy for service with default tx attributes
 */
@SuppressWarnings("unchecked")
public <T> PersistentManager<T, Serializable> makeTransactionalProxy(
        PersistentManager<T, Serializable> service) {
    ProxyFactory factory = new ProxyFactory(service);
    factory.setInterfaces(new Class[] { Dao.class });
    TransactionInterceptor interceptor = new TransactionInterceptor(transactionManager,
            new MatchAlwaysTransactionAttributeSource());
    factory.addAdvice(interceptor);
    factory.setTarget(service);
    return (PersistentManager<T, Serializable>) factory.getProxy();
}