This has been brought up a number of times - Paul re JBoss AS's use of Infinispan, Sanne re: Lucene and several others.
The problem is detailed in JIRA - https://jira.jboss.org/browse/ISPN-658 - along with the beginnings of a solution. Have a look and let me know what you think (on this mail list, not JIRA). My plan is to implement such support for 5.0.