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