code: private void list(Context ctx, String indent, StringBuilder buffer) throws Throwable
     {
        NamingEnumeration<Binding> bindings = ctx.listBindings("");
        while (bindings.hasMore())
        {
           Binding binding = bindings.next();
  
           String name = binding.getName();
           String className = binding.getClassName();
           boolean recursive = Context.class.isAssignableFrom(binding.getObject().getClass());
           boolean isLinkRef = LinkRef.class.isAssignableFrom(binding.getObject().getClass());
  
           buffer.append(indent + " +- " + name);
           
           if (isLinkRef)
           {
              try
              {
                 Object obj = ctx.lookupLink(name);
  
                 LinkRef link = (LinkRef) obj;
                 buffer.append("[link -> ");
                 buffer.append(link.getLinkName());
                 buffer.append(']');
              }
              catch (Throwable t)
              {
                 log.debugf(t, "Invalid LinkRef for: %s", name);
                 buffer.append("invalid]");
              }
           }
  
           buffer.append(" (class: " + className + ")");
  
           buffer.append(NEW_LINE);
           
           if (recursive)
           {
              try
              {
                 Object value = ctx.lookup(name);
                 if (value instanceof Context)
                 {
                    Context subctx = (Context) value;
                    list(subctx, indent + " |  ", buffer);
                 }
                 else
                 {
                    buffer.append(indent + " |   NonContext: " + value);
                    buffer.append(NEW_LINE);
                 }
              }
              catch (Throwable t)
              {
                 buffer.append("Failed to lookup: " + name + ", errmsg=" + t.getMessage());
                 buffer.append(NEW_LINE);
              }
           }
        }
  
        bindings.close();
     }
docs: List
  @param ctx The context
  @param indent The indentation
  @param buffer The buffer
  @exception Throwable Thrown if an error occurs