コード例 #1
0
  /* ------------------------------------------------------------ */
  public void dump(Appendable out, String indent) throws IOException {
    out.append(this.getClass().getSimpleName())
        .append("@")
        .append(Long.toHexString(this.hashCode()))
        .append("\n");
    int size = _bindings.size();
    int i = 0;
    for (Map.Entry<String, Binding> entry : ((Map<String, Binding>) _bindings).entrySet()) {
      boolean last = ++i == size;
      out.append(indent).append(" +- ").append(entry.getKey()).append(": ");

      Binding binding = entry.getValue();
      Object value = binding.getObject();

      if ("comp".equals(entry.getKey())
          && value instanceof Reference
          && "org.eclipse.jetty.jndi.ContextFactory"
              .equals(((Reference) value).getFactoryClassName())) {
        ContextFactory.dump(out, indent + (last ? "    " : " |  "));
      } else if (value instanceof Dumpable) {
        ((Dumpable) value).dump(out, indent + (last ? "    " : " |  "));
      } else {
        out.append(value.getClass().getSimpleName()).append("=");
        out.append(String.valueOf(value).replace('\n', '|').replace('\r', '|'));
        out.append("\n");
      }
    }
  }
コード例 #2
0
 /* ------------------------------------------------------------ */
 @Override
 public void dump(Appendable out, String indent) throws IOException {
   super.dump(out, indent);
   if (_filter instanceof Dumpable) {
     ((Dumpable) _filter).dump(out, indent);
   }
 }
コード例 #3
0
  @Override
  public void dump(Appendable out, String indent) throws IOException {
    super.dump(out, indent);
    out.append(indent).append(" +- incomingHandler : ");
    if (incomingHandler instanceof Dumpable) {
      ((Dumpable) incomingHandler).dump(out, indent + "    ");
    } else {
      out.append(incomingHandler.toString()).append('\n');
    }

    out.append(indent).append(" +- outgoingHandler : ");
    if (outgoingHandler instanceof Dumpable) {
      ((Dumpable) outgoingHandler).dump(out, indent + "    ");
    } else {
      out.append(outgoingHandler.toString()).append('\n');
    }
  }
コード例 #4
0
  @Override
  public void dump(Appendable out, String indent) throws IOException {
    dumpThis(out);
    out.append(indent).append(" +- incomingHandler : ");
    if (incomingHandler instanceof Dumpable) {
      ((Dumpable) incomingHandler).dump(out, indent + "    ");
    } else {
      out.append(incomingHandler.toString()).append(System.lineSeparator());
    }

    out.append(indent).append(" +- outgoingHandler : ");
    if (outgoingHandler instanceof Dumpable) {
      ((Dumpable) outgoingHandler).dump(out, indent + "    ");
    } else {
      out.append(outgoingHandler.toString()).append(System.lineSeparator());
    }
  }