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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access