I have to implement my own connection pool, and I want the connection will automatically return to the pool after some CONNECTION_TIMEOUT. How can I achive that?
Everything that comes to mind is to use ScheduledExecutorService in a separate thread and replan it each time the connection is used.
Any other ideas?