SafeForkJoinWorkerThreadFactory (Apache Tomcat 7.0.108 API Documentation)

org.apache.catalina.startup

## Class SafeForkJoinWorkerThreadFactory

- java.lang.Object
- - org.apache.catalina.startup.SafeForkJoinWorkerThreadFactory

- All Implemented Interfaces:
    ForkJoinPool.ForkJoinWorkerThreadFactory

      public class SafeForkJoinWorkerThreadFactory
      extends Object
      implements ForkJoinPool.ForkJoinWorkerThreadFactory

  Provides a `ForkJoinPool.ForkJoinWorkerThreadFactory` that provides `ForkJoinWorkerThread`s that won't trigger memory leaks due to retained references to web application class loaders.

  Note: This class must be available on the boot strap class path for it to be visible to `ForkJoinPool`.

  Note: This a helper class that is used by memory leak protection code (`JreMemoryLeakPreventionListener`) to workaround a bug in Oracle Java 7 / Java 8 Java Runtime. See bug 60620 for discussion links. As `ForkJoinPool.ForkJoinWorkerThreadFactory` class is available since Java 7 only, compilation of this class is skipped when building Tomcat with Java 6.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SafeForkJoinWorkerThreadFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ForkJoinWorkerThread` | `newThread(ForkJoinPool pool)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SafeForkJoinWorkerThreadFactory

          public SafeForkJoinWorkerThreadFactory()

  - ### Method Detail

    - #### newThread

          public ForkJoinWorkerThread newThread(ForkJoinPool pool)

      Specified by:
        `newThread` in interface `ForkJoinPool.ForkJoinWorkerThreadFactory`

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.