1 23 package com.sun.enterprise.naming.factory; 24 25 import javax.naming.*; 26 import javax.naming.spi.*; 27 28 import java.util.Hashtable ; 29 import com.sun.enterprise.util.ORBManager; 30 31 import java.util.logging.*; 33 import com.sun.logging.*; 34 36 37 41 42 public class IIOPObjectFactory implements ObjectFactory { 43 44 static Logger _logger=LogDomains.getLogger(LogDomains.JNDI_LOGGER); 46 48 public static final boolean debug = false; 49 Hashtable env = new Hashtable (); 50 51 public Object getObjectInstance(Object obj, 52 Name name, 53 Context nameCtx, 54 Hashtable env) throws Exception 55 { 56 env.put("java.naming.factory.initial", 57 "com.sun.jndi.cosnaming.CNCtxFactory"); 58 59 InitialContext ic = new InitialContext(env); 60 61 Reference ref = (Reference) obj; 62 if(debug) { 63 67 if(_logger.isLoggable(Level.FINE)) { 69 _logger.log(Level.FINE,"IIOPObjectFactory " + ref + 70 " Name:" + name); 71 } 72 } 74 RefAddr refAddr = ref.get("url"); 75 Object realObject = ic.lookup((String ) refAddr.getContent()); 76 if(debug) { 77 80 if(_logger.isLoggable(Level.FINE)) { 82 _logger.log(Level.FINE,"Found Object:" + realObject); 83 } 84 } 86 return realObject; 87 } 88 89 } 90 | Popular Tags |