public void rename(Name oldName, Name newName) throws NamingException { bind(newName, lookup(oldName)); unbind(oldName); }
protected Object resolveLink(Object res, Hashtable refEnv) throws NamingException { Object linkResult = null; try { LinkRef link = (LinkRef) res; String ref = link.getLinkName(); if (ref.startsWith("./")) linkResult = lookup(ref.substring(2)); else if (refEnv != null) linkResult = new InitialContext(refEnv).lookup(ref); else linkResult = new InitialContext().lookup(ref); } catch (Exception e) { NamingException ex = new NamingException("Could not dereference object"); ex.setRootCause(e); throw ex; } return linkResult; }
public Object lookup(String name) throws NamingException { return lookup(getNameParser(name).parse(name)); }
return lookup(name);