Cover by Javier Fernández González

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Monitoring an Executor framework

The Executor framework provides a mechanism that separates the implementation of tasks from the thread creation and management to execute those tasks. If you use an executor, you only have to implement the Runnable objects and send them to the executor. It is the responsibility of an executor to manage threads. When you send a task to an executor, it tries to use a pooled thread for the execution of this task, to avoid creating new threads. This mechanism is offered by the Executor interface and its implementing classes as the ThreadPoolExecutor class.

In this recipe, you're going to learn what information you can obtain about the status of a ThreadPoolExecutor executor and how to obtain it.

Getting ready

The example ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required