1 23 24 package com.sun.jndi.url.corbaname; 25 26 import javax.naming.Context ; 27 import javax.naming.NamingException ; 28 import org.omg.CORBA.ORB ; 29 import org.omg.CosNaming.NamingContext ; 30 import java.util.Hashtable ; 31 32 import com.sun.jndi.cosnaming.CNCtxFactory; 33 34 38 39 final public class CNCtxHelper { 40 public static final Context getInstance(ORB orb, org.omg.CORBA.Object ncref, 41 Hashtable env) throws NamingException { 42 if (env != null) { 43 env = (Hashtable ) env.clone(); 44 } 45 46 String ncrefStr = orb.object_to_string(ncref); 48 49 env.put(Context.PROVIDER_URL, ncrefStr); 50 51 return new CNCtxFactory().getInitialContext(env); 52 } 53 } 54 | Popular Tags |