I want to use an object pool for managing SMTP server connections, since they are very expensive to create (takes half of the total time of sending an email). So far I found the only options to be:
Doesn't the JDK provide an object pool? I rather not depend on a 3rd party and this seems like a pretty generic/basic feature to me.
Doesn't the JDK provide an object pool?
As of Java 11, the Java SE libraries do not provide a general purpose object pool.
But if you look around, you will probably find a range of 3rd party libraries which do.
I rather not depend on a 3rd party.
In the words of the Rolling Stones song:
"No, you can't always get what you want ...."
But seriously, the Sun / Oracle Java developers never saw as it as Java SE's role to provide all of the libraries you could possibly ever need. If you exclude 3rd party dependencies from your products, then you will end up writing and maintaining a lot more code than is necessary.