[
https://issues.apache.org/jira/browse/COLLECTIONS-241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Elifarley Callado Coelho updated COLLECTIONS-241:
-------------------------------------------------
Attachment: PassiveTimeOutMap.zip
Source code for PassiveTimeOutMap class, and a ready-to-use usage example (you
can run it by using ptom.bat or ptom.sh).
> [contribution] PassiveTimeOutMap
> --------------------------------
>
> Key: COLLECTIONS-241
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-241
> Project: Commons Collections
> Issue Type: New Feature
> Components: Map
> Reporter: Elifarley Callado Coelho
> Priority: Minor
> Attachments: PassiveTimeOutMap.zip
>
>
> This is a Map decorator which passively evicts expired keys once their expiry
> time has been reached.
> When putting a key-value pair in the map, this decorator calls
> expiryTime(key, value), passing the key and the value as parameters, and uses
> the returned value as the expiry time for that key.
> When getting the value for a key, its expiry time is checked, and if it's
> greater than the current time, the value is returned. Otherwise, the key is
> removed from the decorated map, and null is returned.
> Doing so, there's no need to have a separate, active thread (hence the name
> 'passive') to check expiry times - the check is performed on demand.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]