コード例 #1
0
  /**
   * I have suggested that people can rely on the thread names to change priorities etc. The names
   * should stay fixed.
   */
  @Test
  public void testThreadNamingAndManipulation() {

    singletonManager = CacheManager.create();

    List threads = JVMUtil.enumerateThreads();

    for (int i = 0; i < threads.size(); i++) {
      Thread thread = (Thread) threads.get(i);
      String name = thread.getName();
      LOG.info(name);
    }
  }
コード例 #2
0
 private int countThreads() {
   return JVMUtil.enumerateThreads().size();
 }