A what? A little Googling helped me found out you meant a Message Driven Bean, but my first guess question when I read this thread was "what does an MS Access database have to do with reading messages from a queue?". Next time, please don't use acronyms that aren't 100% clear to everybody.
As for the problem, have you searched around? Have you thought of a way to solve this yourself? I think I've seen an implementation for this once but I can't remember where.
My solution might not be the best, but I think I'd do it by extending HashMap, and using a helper class that contains a value and a timeAdded field as values in the extended HashMap class. I'd override the put() method to add instances of the helper class, and override the get() method to return the value of the helper class mapped to a particular key. That way, it's completely abstracted to the developer. Lastly, you could just have a timer which periodically loops through all of the values in your maps and remove those which were added more than 5 seconds ago. (Hint: Use System.currentTimeMillis())
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." - George Bernard Shaw
Well that's one way. I wouldn't use this map directly though; it will have issues with values() and entrySet() as these will contain the helper classes. You could use that map inside a wrapper similar to those of Collections.synchronizedMap and Collections.unmodifiableMap.
Another issue is when to remove entries. You can use a timer like you suggested. Another option is to remove on demand. The get method would look a bit like this then:
Of course entries may need to be invalidated when using several other methods as well. Think of methods like containsKey and containsValue, and the iterators over the keySet(), values() and entrySet() collections.
So the timer is probably the easiest solution if you can at least keep synchronization issues at bay.