1 28 29 package com.caucho.transaction.enhancer; 30 31 import com.caucho.java.JavaWriter; 32 import com.caucho.java.gen.CallChain; 33 import com.caucho.java.gen.FilterCallChain; 34 import com.caucho.util.L10N; 35 36 import java.io.IOException ; 37 38 41 public class SupportsCallChain extends FilterCallChain { 42 private static final L10N L = new L10N(SupportsCallChain.class); 43 44 public SupportsCallChain(CallChain next) 45 { 46 super(next); 47 } 48 49 57 public void generateCall(JavaWriter out, String retVar, 58 String var, String []args) 59 throws IOException 60 { 61 out.println("com.caucho.transaction.TransactionContainer _caucho_xa_c;"); 62 out.println("_caucho_xa_c = com.caucho.transaction.TransactionContainer.getTransactionContainer();"); 63 out.println("javax.transaction.Transaction _caucho_xa;"); 64 65 out.println("try {"); 66 out.pushDepth(); 67 68 super.generateCall(out, retVar, var, args); 69 70 out.popDepth(); 71 out.println("} catch (RuntimeException e) {"); 72 out.println(" _caucho_xa_c.setRollbackOnly(e);"); 73 out.println(" throw e;"); 74 out.println("}"); 75 } 76 } 77 | Popular Tags |