code: @GET
      @Path("stack")
      @Produces(MediaType.TEXT_PLAIN)
      public String getThreadDump() {
          if (LOG.isDebugEnabled()) {
              LOG.debug("==> AdminResource.getThreadDump()");
          }
  
          ThreadGroup topThreadGroup = Thread.currentThread().getThreadGroup();
  
          while (topThreadGroup.getParent() != null) {
              topThreadGroup = topThreadGroup.getParent();
          }
          Thread[] threads = new Thread[topThreadGroup.activeCount()];
  
          int nr = topThreadGroup.enumerate(threads);
          StringBuilder builder = new StringBuilder();
          for (int i = 0; i < nr; i++) {
              builder.append(threads[i].getName()).append("\nState: ").
                      append(threads[i].getState()).append("\n");
              String stackTrace = StringUtils.join(threads[i].getStackTrace(), "\n");
              builder.append(stackTrace);
          }
  
          if (LOG.isDebugEnabled()) {
              LOG.debug("<== AdminResource.getThreadDump()");
          }
  
          return builder.toString();
      }
docs: Fetches the thread stack dump for this application.
  
  @return json representing the thread stack dump.