|
spring-tx | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.transaction.interceptor.MethodMapTransactionAttributeSource
public class MethodMapTransactionAttributeSource
Simple TransactionAttributeSource implementation that
allows attributes to be stored per method in a Map.
isMatch(java.lang.String, java.lang.String),
NameMatchTransactionAttributeSource| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses |
| Constructor Summary | |
|---|---|
MethodMapTransactionAttributeSource()
|
|
| Method Summary | |
|---|---|
void |
addTransactionalMethod(java.lang.Class<?> clazz,
java.lang.String mappedName,
TransactionAttribute attr)
Add an attribute for a transactional method. |
void |
addTransactionalMethod(java.lang.reflect.Method method,
TransactionAttribute attr)
Add an attribute for a transactional method. |
void |
addTransactionalMethod(java.lang.String name,
TransactionAttribute attr)
Add an attribute for a transactional method. |
void |
afterPropertiesSet()
Eagerly initializes the specified "methodMap", if any. |
boolean |
equals(java.lang.Object other)
|
TransactionAttribute |
getTransactionAttribute(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
Return the transaction attribute for this method. |
int |
hashCode()
|
protected void |
initMethodMap(java.util.Map<java.lang.String,TransactionAttribute> methodMap)
Initialize the specified "methodMap", if any. |
protected boolean |
isMatch(java.lang.String methodName,
java.lang.String mappedName)
Return if the given method name matches the mapped name. |
void |
setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
|
void |
setMethodMap(java.util.Map<java.lang.String,TransactionAttribute> methodMap)
Set a name/attribute map, consisting of "FQCN.method" method names (e.g. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public MethodMapTransactionAttributeSource()
| Method Detail |
|---|
public void setMethodMap(java.util.Map<java.lang.String,TransactionAttribute> methodMap)
TransactionAttribute instances (or Strings to be converted
to TransactionAttribute instances).
Intended for configuration via setter injection, typically within
a Spring bean factory. Relies on afterPropertiesSet()
being called afterwards.
methodMap - said Map from method name to attribute valueTransactionAttribute,
TransactionAttributeEditorpublic void setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAwarepublic void afterPropertiesSet()
"methodMap", if any.
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeaninitMethodMap(java.util.Map)protected void initMethodMap(java.util.Map<java.lang.String,TransactionAttribute> methodMap)
"methodMap", if any.
methodMap - Map from method names to TransactionAttribute instancessetMethodMap(java.util.Map)
public void addTransactionalMethod(java.lang.String name,
TransactionAttribute attr)
Method names can end or start with "*" for matching multiple methods.
name - class and method name, separated by a dotattr - attribute associated with the method
java.lang.IllegalArgumentException - in case of an invalid name
public void addTransactionalMethod(java.lang.Class<?> clazz,
java.lang.String mappedName,
TransactionAttribute attr)
clazz - target interface or classmappedName - mapped method nameattr - attribute associated with the method
public void addTransactionalMethod(java.lang.reflect.Method method,
TransactionAttribute attr)
method - the methodattr - attribute associated with the method
protected boolean isMatch(java.lang.String methodName,
java.lang.String mappedName)
The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality.
methodName - the method name of the classmappedName - the name in the descriptor
PatternMatchUtils.simpleMatch(String, String)
public TransactionAttribute getTransactionAttribute(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
TransactionAttributeSource
getTransactionAttribute in interface TransactionAttributeSourcemethod - methodtargetClass - target class. May be null, in which
case the declaring class of the method must be used.
null if none foundpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
spring-tx | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||