Did you mean eviction or expiration?
You can set the expiration with the hot rod api
My requirement is to get a notifcaion after the time mentioned in "put" API expires. I will do some processing based on the timeout and will then decide whether or not to remove the record.
While testing, I am receiving notifications when I delete entries explicitly from my client, but no notifications are coming when the record expires and is removed from cache.
I am using persistence mode with replication mode.
Expiration listeners are not currently implemented. The JIRA to implement that can be found here [ISPN-694] Create expiration notification for in-memory cache entries - JBoss Issue Tracker
Also the FAQs in documentation talks about this briefly http://infinispan.org/docs/7.0.x/faqs/faqs.html#_why_isn_t_there_a_notification_for_the_expiration_of_a_cache_entry It sounds like your use case is exactly what the FAQ page talks about as an issue since there is no guarantee when the expiration would fire in this case.
If you want some logic on a timer maybe try using a ScheduledThreadExecutor http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html ?