1 28 29 package com.caucho.ejb.gen; 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 SessionPoolChain extends FilterCallChain { 42 private static L10N L = new L10N(SessionPoolChain.class); 43 44 public SessionPoolChain(CallChain next) 45 { 46 super(next); 47 } 48 49 56 public void generateCall(JavaWriter out, String retVar, 57 String var, String []args) 58 throws IOException 59 { 60 out.println("Bean ptr = _context._ejb_begin(trans);"); 61 62 out.println("try {"); 63 out.pushDepth(); 64 65 super.generateCall(out, retVar, "ptr", args); 66 67 out.popDepth(); 68 out.println("} catch (RuntimeException e) {"); 69 out.pushDepth(); 70 out.println("ptr = null;"); 71 72 out.println("throw e;"); 73 74 out.popDepth(); 75 76 out.println("} finally {"); 77 out.pushDepth(); 78 79 out.println("_context._ejb_free(ptr);"); 80 81 out.popDepth(); 82 out.println("}"); 83 } 84 } 85 | Popular Tags |