public SpringTransactionInterceptorBinding() {
super("spring-transaction-interceptor");
}
public Object parse(Element element, Parse parse, Parser parser) {
SpringTransactionInterceptor springTransactionInterceptor = new SpringTransactionInterceptor();
if ( element.hasAttribute("policy")
&& ("requiresNew".equals(element.getAttribute("policy")))
) {
springTransactionInterceptor.setPolicy(Policy.REQUIRES_NEW);
}
String transactionManagerName = XmlUtil.attribute(element, "transaction-manager");
if (transactionManagerName != null) {
springTransactionInterceptor.setTransactionManagerName(transactionManagerName);
}
return new ProvidedObjectDescriptor(springTransactionInterceptor);
}