O'Reilly logo

Apache Jakarta Commons: Reusable Java™ Components by Will Iverson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required