throws NamingException {
// name to lookup in the external factory
String jndiLookupName = "";
String jndiFactoryClass = null;
ResourceInfo resourceInfo = null;
// get the target initial naming context and the lookup name
Reference ref = (Reference) obj;
Enumeration addrs = ref.getAll();
while (addrs.hasMoreElements()) {
RefAddr addr = (RefAddr) addrs.nextElement();
String prop = addr.getType();
if (prop.equals("resourceInfo")) {
resourceInfo = (ResourceInfo)addr.getContent();
}
else if (prop.equals("jndiLookupName")) {
jndiLookupName = (String) addr.getContent();
}
else if (prop.equals("jndiFactoryClass")) {
jndiFactoryClass = (String) addr.getContent();
}
}
if (resourceInfo == null) {
throw new NamingException("JndiProxyObjectFactory: no resourceInfo context info");
}
ProxyRefAddr contextAddr =
(ProxyRefAddr)ref.get(resourceInfo.getName());
Hashtable env = null;
if (contextAddr == null ||
jndiFactoryClass == null ||
(env = (Hashtable)(contextAddr.getContent())) == null) {
throw new NamingException("JndiProxyObjectFactory: no info in the " +