In this recipe, you have implemented the following elements:
- Your own worker thread class: You have implemented the AlwaysThrowsExceptionWorkerThread class, which extends the ForkJoinWorkerThread class, which implements the worker threads of a fork/join pool. You have overridden the onStart() method. This method is executed when a worker thread starts its execution. It simply throws an exception RuntimeException upon being called.
- Your own thread factory: A ForkJoinPool class creates its worker threads using a factory. As you want to create a ForkJoinPool object that uses the AlwaysThrowsExceptionWorkerThreadFactory worker threads, you have implemented a factory that creates them. To implement a worker thread factory, you ...