1 25 package org.objectweb.jonas.security.iiop; 26 27 import javax.naming.Context ; 28 import javax.naming.InitialContext ; 29 import javax.naming.NamingException ; 30 import javax.rmi.PortableRemoteObject ; 31 32 import org.omg.CORBA.ORB ; 33 34 35 39 public class ORBHelper { 40 41 44 private static ORB orb = null; 45 46 47 50 private ORBHelper() { 51 52 } 53 54 58 public static ORB getOrb() throws Csiv2InterceptorException { 59 if (orb != null) { 60 return orb; 61 } 62 63 Context ictx = null; 65 try { 66 ictx = new InitialContext (); 67 } catch (NamingException ne) { 68 throw new Csiv2InterceptorException("Cannot instatiate InitialContext", ne); 69 } 70 71 try { 72 orb = (ORB ) PortableRemoteObject.narrow(ictx.lookup("java:comp/ORB"), ORB .class); 73 } catch (NamingException ne) { 74 throw new Csiv2InterceptorException("Cannot lookup java:comp/ORB", ne); 75 } 76 return orb; 77 } 78 79 80 } 81 | Popular Tags |