Chapter 10. Concurrency Utilities

Concurrency Utilities for Java EE are defined as JSR 236, and the complete specification can be downloaded.

Concurrency Utilities for Java EE provides a simple, standardized API for using concurrency from application components without compromising container integrity while still preserving the Java EE platform’s fundamental benefits.

Java EE containers such as the EJB or web container do not allow using common Java SE concurrency APIs such as java.util.concurrent.ThreadPoolExecutor, java.lang.Thread, or java.util.Timer directly. This is because all application code is run on a thread managed by the container, and each container typically expects all access to container-supplied objects to occur on the same thread. This allows the container to manage the resources and provide centralized administration. Further, using resources in a nonmanaged way is discouraged, because it can potentially undermine the enterprise features that the platform is designed to provide, such as availability, security, reliability, and scalability.

This API extends the Concurrency Utilities API developed under JSR-166y and found in Java 2 Platform, Standard Edition 7 (Java SE 7) in the java.util.concurrent package. Application developers familiar with this API can leverage existing libraries and usage patterns with little modification. This will allow you to add concurrency design principles to existing Java EE applications using existing design patterns.

Asynchronous ...

Get Java EE 7 Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.