Hello,
good question.
Hibernate Search can use Infinispan by grabbing a reference to the CacheManager in various ways:
- Point it to an Infinispan configuration file in XML format
- Lookup and Infinispan CacheManager by JNDI name
- Inject your own CacheManager instance into Hibernate at bootstrap, by passing in your custom implementation of a org.infinispan.hibernate.search.spi.CacheManagerService
To pass the instance of a CacheManager into the Hibernate boot process will of course require that your start Hibernate programmatically as well, but also requires Hibernate Search to be bootstrapped with a custom implementation of
org.hibernate.search.cfg.spi.SearchConfiguration so that's not very practical at all. I'm filing
https://hibernate.atlassian.net/browse/HSEARCH-2514 to follow up on that.
Would using JNDI work for you for now?
Some notes on the CacheManager Service integration, in case you want to try having a look yourself:
It might help to consider that the CacheManager is handled as a Service, so these extension points apply:
-
https://docs.jboss.org/hibernate/search ... n-servicesThis is the source code of the *default* implementation of such Service, but you can provide your own:
-
https://github.com/infinispan/infinispa ... rvice.javaThis is the "very complex" interface that you'll have to implement:
-
https://github.com/infinispan/infinispa ... rvice.java