Beispiel #1
0
  /**
   * Lists the bindings of a context or subcontext. The operation is delegated to the serial
   * context.
   *
   * @return an enumeration of the bindings of the context.
   * @throws NamingException if there is a naming exception.
   */
  @Override
  public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
    if (name.equals("")) {
      // listing this context
      if (namingManager == null) throw new NamingException();
      return namingManager.listBindings(myName);
    }

    // Perhaps 'name' names a context
    Object target = lookup(name);
    if (target instanceof Context) {
      return ((Context) target).listBindings("");
    }
    throw new NotContextException(name + " cannot be listed");
  }