@Override
  public Object lookup(Name name) throws NamingException {
    checkIsDestroyed();
    try {
      Name parsedName = getParsedName(name);
      String nameComponent = parsedName.get(0);
      Object res = ctxMaps.get(nameComponent);
      if (res instanceof UserTransactionImpl) {
        res = new UserTransactionImpl();
      }
      // if not found
      if (!ctxMaps.containsKey(nameComponent)) {
        throw new NameNotFoundException(
            String.format("Name %s not found", name));
      }
      // if this is a compound name
      else if (parsedName.size() > 1) {
        if (res instanceof ContextImpl) {
          res = ((ContextImpl) res).lookup(parsedName.getSuffix(1));
        } else {
          throw new NotContextException(
              String.format("Expected ContextImpl but found %s", res));
        }
      }
      return res;
    } catch (NameNotFoundException e) {
      LogWriter writer = TransactionUtils.getLogWriter();
      if (writer.infoEnabled()) {
        writer.info(String.format("ContextImpl::lookup::Error while looking up %s", name),
            e);
      }
      throw new NameNotFoundException(
          String.format("Name %s not found", name));
    } catch (SystemException se) {
      LogWriter writer = TransactionUtils.getLogWriter();
      if (writer.severeEnabled()) {
        writer.info(
            "ContextImpl::lookup::Error while creating UserTransaction object",
            se);
      }
      throw new NameNotFoundException(
          "ContextImpl::lookup::Error while creating UserTransaction object");
    }
  }
Looks up object with binding name name in this context.

@param name name to look up
@return object reference bound to name name.
@throws NoPermissionException if this context has been destroyed.
@throws InvalidNameException if name is CompositeName that spans more than one naming system
@throws NameNotFoundException if name can not be found.
@throws NotContextException component of name is not bound to instance of ContextImpl, when
        name is not atomic name.
@throws NamingException if any other naming error occurs
geode-core/src/main/java/org/apache/geode/internal/jndi/ContextImpl.java