Java EE 7 Application Developer — Question 19
How can you configure, in a portable way, the number of threads used by a ManagedExecutorService?
Answer options
- A. programmatically, using a ManagedExecutorService
- B. using the ManagedExecutors utility class to define the execution properties
- C. This cannot be done because this configuration is dependent on the Java EE Product Provider.
- D. configuring the thread pool info in the deployment descriptor
Correct answer: A
Explanation
The correct answer is A because you can configure the thread count programmatically with a ManagedExecutorService, allowing for portability across different environments. Options B and D suggest using utility classes or deployment descriptors, which are not portable solutions. Option C incorrectly states that configuration isn't possible, which is false as it can be done programmatically.