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 MandatoryCallChain extends FilterCallChain { 43 private static final L10N L = new L10N(MandatoryCallChain.class); 44 45 public MandatoryCallChain(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 65 out.println("_caucho_xa_c.beginMandatory();"); 66 67 out.println("try {"); 68 out.pushDepth(); 69 70 super.generateCall(out, retVar, var, args); 71 72 out.popDepth(); 73 out.println("} catch (RuntimeException e) {"); 74 out.println(" _caucho_xa_c.setRollbackOnly(e);"); 75 out.println(" throw e;"); 76 out.println("}"); 77 } 78 } 79 | Popular Tags |