00001 00026 package org.objectweb.jonas_ejb.svc; 00027 00028 import javax.ejb.spi.HandleDelegate; 00029 import javax.naming.InitialContext; 00030 import javax.naming.NamingException; 00031 import javax.rmi.PortableRemoteObject; 00032 00033 import org.omg.CORBA.ORB; 00034 00035 00040 public class Utility { 00041 00045 private static ORB orb = null; 00046 00050 private static HandleDelegate hdlDel = null; 00051 00055 private Utility() { 00056 } 00057 00063 public static HandleDelegate getHandleDelegate() throws NamingException { 00064 if (hdlDel == null) { 00065 InitialContext ictx = new InitialContext(); 00066 hdlDel = (HandleDelegate) ictx.lookup("java:comp/HandleDelegate"); 00067 } 00068 return hdlDel; 00069 } 00075 public static ORB getORB() throws NamingException { 00076 InitialContext ictx = new InitialContext(); 00077 orb = (ORB) PortableRemoteObject.narrow(ictx.lookup("java:comp/ORB"), ORB.class); 00078 return orb; 00079 } 00080 }