/** {@inheritDoc} */ public Object lookup(final String name) throws NamingException { return lookup(name, true); }
/** {@inheritDoc} */ public Object lookup(final Name name) throws NamingException { return lookup(name, true); }
public Object lookup(final String name, boolean dereference) throws NamingException { return lookup(parseName(name), dereference); }
private Object resolveLink(Object result, boolean dereference) throws NamingException { final Object linkResult; try { final LinkRef linkRef = (LinkRef) result; final String referenceName = linkRef.getLinkName(); if (referenceName.startsWith("./")) { linkResult = lookup(parseName(referenceName.substring(2)) ,dereference); } else { linkResult = new InitialContext().lookup(referenceName); } } catch (Throwable t) { throw NamingLogger.ROOT_LOGGER.cannotDeferenceObject(t); } return linkResult; }
public Object lookup(final Name name, boolean dereference) throws NamingException { final ParsedName parsedName = parse(name); final Context namespaceContext = findContext(name, parsedName); if (namespaceContext == null) return super.lookup(parsedName.remaining(),dereference); else return namespaceContext.lookup(parsedName.remaining()); }
final Object value; if(context instanceof NamingContext) { value = ((NamingContext)context).lookup(pair.getName(), false); } else { value = context.lookup(pair.getName());
/** {@inheritDoc} */ public void rename(final Name oldName, final Name newName) throws NamingException { //check for appropriate permissions first so that no other info leaks from this context //in case of insufficient perms (like the fact if it is readonly or not) check(oldName, JndiPermission.ACTION_LOOKUP | JndiPermission.ACTION_UNBIND); check(newName, JndiPermission.ACTION_BIND); if (namingStore instanceof WritableNamingStore) { bind(newName, lookup(oldName)); unbind(oldName); } else { throw NamingLogger.ROOT_LOGGER.readOnlyNamingContext(); } }
/** {@inheritDoc} */ public Object lookupLink(Name name) throws NamingException { check(name, JndiPermission.ACTION_LOOKUP); if (name.isEmpty()) { return lookup(name); } try { final Name absoluteName = getAbsoluteName(name); Object link = namingStore.lookup(absoluteName); if (!(link instanceof LinkRef) && link instanceof Reference) { link = getObjectInstance(link, name, null); } return link; } catch (Exception e) { throw namingException(NamingLogger.ROOT_LOGGER.cannotLookupLink(), e, name); } }
final Context continuationContext = NamingManager.getContinuationContext(cpe); if (continuationContext instanceof NamingContext) { result = ((NamingContext)continuationContext).lookup(cpe.getRemainingName(), dereference); } else { result = continuationContext.lookup(cpe.getRemainingName()); return ((NamingContext)namingContext).lookup(resolveResult.getRemainingName(), dereference); } else { return namingContext.lookup(resolveResult.getRemainingName());
/** {@inheritDoc} */ public NamingEnumeration<NameClassPair> list(final Name name) throws NamingException { check(name, JndiPermission.ACTION_LIST); try { return namingEnumeration(namingStore.list(getAbsoluteName(name))); } catch(CannotProceedException cpe) { final Context continuationContext = NamingManager.getContinuationContext(cpe); return continuationContext.list(cpe.getRemainingName()); } catch (RequireResolveException r) { final Object o = lookup(r.getResolve()); if (o instanceof Context) { return ((Context)o).list(name.getSuffix(r.getResolve().size())); } throw notAContextException(r.getResolve()); } }
/** {@inheritDoc} */ public NamingEnumeration<Binding> listBindings(final Name name) throws NamingException { check(name, JndiPermission.ACTION_LIST_BINDINGS); try { return namingEnumeration(namingStore.listBindings(getAbsoluteName(name))); } catch(CannotProceedException cpe) { final Context continuationContext = NamingManager.getContinuationContext(cpe); return continuationContext.listBindings(cpe.getRemainingName()); } catch (RequireResolveException r) { final Object o = lookup(r.getResolve()); if (o instanceof Context) { return ((Context)o).listBindings(name.getSuffix(r.getResolve().size())); } throw notAContextException(r.getResolve()); } }
/** {@inheritDoc} */ public Object lookup(final Name name) throws NamingException { return lookup(name, true); }
/** {@inheritDoc} */ public Object lookup(final Name name) throws NamingException { return lookup(name, true); }
/** {@inheritDoc} */ public Object lookup(final String name) throws NamingException { return lookup(name, true); }
/** {@inheritDoc} */ public Object lookup(final String name) throws NamingException { return lookup(name, true); }
public Object lookup(final String name, boolean dereference) throws NamingException { return lookup(parseName(name), dereference); }
public Object lookup(final Name name, boolean dereference) throws NamingException { final ParsedName parsedName = parse(name); final Context namespaceContext = findContext(name, parsedName); if (namespaceContext == null) return super.lookup(parsedName.remaining(),dereference); else return namespaceContext.lookup(parsedName.remaining()); }
public Object lookup(final Name name, boolean dereference) throws NamingException { final ParsedName parsedName = parse(name); final Context namespaceContext = findContext(name, parsedName); if (namespaceContext == null) return super.lookup(parsedName.remaining(),dereference); else return namespaceContext.lookup(parsedName.remaining()); }
/** {@inheritDoc} */ public void rename(final Name oldName, final Name newName) throws NamingException { //check for appropriate permissions first so that no other info leaks from this context //in case of insufficient perms (like the fact if it is readonly or not) check(oldName, Action.LOOKUP, Action.UNBIND); check(newName, Action.BIND); if (namingStore instanceof WritableNamingStore) { bind(newName, lookup(oldName)); unbind(oldName); } else { throw MESSAGES.readOnlyNamingContext(); } }
/** {@inheritDoc} */ public void rename(final Name oldName, final Name newName) throws NamingException { //check for appropriate permissions first so that no other info leaks from this context //in case of insufficient perms (like the fact if it is readonly or not) check(oldName, JndiPermission.ACTION_LOOKUP | JndiPermission.ACTION_UNBIND); check(newName, JndiPermission.ACTION_BIND); if (namingStore instanceof WritableNamingStore) { bind(newName, lookup(oldName)); unbind(oldName); } else { throw NamingLogger.ROOT_LOGGER.readOnlyNamingContext(); } }