1 16 17 package org.springframework.aop.framework.autoproxy.metadata; 18 19 import org.springframework.aop.framework.autoproxy.target.PoolingAttribute; 20 import org.springframework.metadata.support.MapAttributes; 21 import org.springframework.transaction.interceptor.DefaultTransactionAttribute; 22 import org.springframework.transaction.interceptor.NoRollbackRuleAttribute; 23 import org.springframework.transaction.interceptor.RollbackRuleAttribute; 24 import org.springframework.transaction.interceptor.RuleBasedTransactionAttribute; 25 26 31 public class DummyAttributes extends MapAttributes { 32 33 public DummyAttributes() throws Exception { 34 register(TxClassImpl.class.getMethod("defaultTxAttribute", (Class []) null), 35 new Object [] { new DefaultTransactionAttribute()}); 36 37 Object [] echoAtts = new Object [] { 38 new RuleBasedTransactionAttribute(), 39 new RollbackRuleAttribute("java.lang.Exception"), 40 new NoRollbackRuleAttribute("ServletException") 41 }; 42 43 register(TxClassImpl.class.getMethod("echoException", new Class [] { Exception .class }), echoAtts); 44 45 PoolingAttribute pa = new PoolingAttribute(10); 46 register(TxClassWithClassAttribute.class, new Object [] { new DefaultTransactionAttribute(), pa }); 47 register(TxClassWithClassAttribute.class.getMethod("echoException", new Class [] { Exception .class }), echoAtts); 48 49 register(ThreadLocalTestBean.class, new Object [] { new ThreadLocalAttribute() }); 50 register(PrototypeTestBean.class, new Object [] { new PrototypeAttribute() }); 51 52 register(ModifiableTestBean.class, new Object [] { new ModifiableAttribute() }); 53 } 54 55 } 56 | Popular Tags |