I want to implement mechanism which will be closing connections if there are not used by specific period of time. This time is constant for all of the connections. Opened connections can be used many times, so I need to update usage time and always compute difference between current time and usage time. I also need to close connections which excess my timeout. 

My opened connections are in Map. (`Map<Id, Connection>`) where `Id` is an `Integer`. 

I thought about resolving my problem with `DelayQueue`, but there is no possible to update usage (in this case delay) time in this type of `Queue`. 

I also know that this mechanism should work in separate thread. 

Please, give me some tip about the best way of implementation or example. What kind of data structure should I use? 
I can use Spring also (maybe there is some good mechanism and I don't know about it).