Chapter 5. Pool

Not all Java objects are created equal. For example, some take considerably longer to create than others—an object that establishes a secure network connection can take several seconds to properly initialize. Other objects might consume significant resources. In order to minimize the creation of these objects, you may want to maintain a pool of objects—a little bit of bookkeeping to keep track of a group of objects, checked out and returned as needed. The Apache Jakarta Commons Pool package provides interfaces and implementation to make that task much easier.

Although some people might think that an object pool is easy to write, by using the Pool package, a wide suite of built-in, well-tested behaviors is provided for free. For ...

Get Apache Jakarta Commons: Reusable Java™ Components 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.