Example usage for org.springframework.transaction.interceptor NameMatchTransactionAttributeSource setProperties

List of usage examples for org.springframework.transaction.interceptor NameMatchTransactionAttributeSource setProperties

Introduction

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

Prototype

public void setProperties(Properties transactionAttributes) 

Source Link

Document

Parses the given properties into a name/attribute map.

Usage

From source file:org.springframework.transaction.interceptor.TransactionAspectSupport.java

/**
 * Set properties with method names as keys and transaction attribute
 * descriptors (parsed via TransactionAttributeEditor) as values:
 * e.g. key = "myMethod", value = "PROPAGATION_REQUIRED,readOnly".
 * <p>Note: Method names are always applied to the target class,
 * no matter if defined in an interface or the class itself.
 * <p>Internally, a NameMatchTransactionAttributeSource will be
 * created from the given properties.//from w  ww  . jav a 2 s.c  o m
 * @see #setTransactionAttributeSource
 * @see TransactionAttributeEditor
 * @see NameMatchTransactionAttributeSource
 */
public void setTransactionAttributes(Properties transactionAttributes) {
    NameMatchTransactionAttributeSource tas = new NameMatchTransactionAttributeSource();
    tas.setProperties(transactionAttributes);
    this.transactionAttributeSource = tas;
}