1 25 26 package org.objectweb.jonas_ejb.svc; 27 28 import javax.ejb.spi.HandleDelegate ; 29 import javax.naming.InitialContext ; 30 import javax.naming.NamingException ; 31 import javax.rmi.PortableRemoteObject ; 32 33 import org.omg.CORBA.ORB ; 34 35 36 40 public class Utility { 41 42 45 private static ORB orb = null; 46 47 50 private static HandleDelegate hdlDel = null; 51 52 55 private Utility() { 56 } 57 58 63 public static HandleDelegate getHandleDelegate() throws NamingException { 64 if (hdlDel == null) { 65 InitialContext ictx = new InitialContext (); 66 hdlDel = (HandleDelegate ) ictx.lookup("java:comp/HandleDelegate"); 67 } 68 return hdlDel; 69 } 70 75 public static ORB getORB() throws NamingException { 76 InitialContext ictx = new InitialContext (); 77 orb = (ORB ) PortableRemoteObject.narrow(ictx.lookup("java:comp/ORB"), ORB .class); 78 return orb; 79 } 80 } | Popular Tags |