Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Infinispan programatic configuration
PostPosted: Fri Oct 21, 2016 3:00 pm 
Newbie

Joined: Fri Oct 21, 2016 2:53 pm
Posts: 1
I would like to use the infinispan programatic configuration instead of the XML. But I see the hibernate search take the xml file in the hibernate.search.infinispan.configuration_resourcename property. Is there way it can take the class that builds the configuration?


Top
 Profile  
 
 Post subject: Re: Infinispan programatic configuration
PostPosted: Tue Nov 22, 2016 5:58 am 
Newbie

Joined: Tue Nov 22, 2016 5:49 am
Posts: 1
Well, there should be a reason why the hibernate search take the xml file. Let me see what we can do here. I have been thinking that if we can make this way:
Configuration b = new ConfigurationBuilder()clustering()cacheMode(CacheMode.REPL_SYC).build();
String newCacheName = "repl";
manag.defConfiguration(new CacheName, c);
Cache<String, String> cache = manager.get buying essays Cache(newCacheName); try to change settings like that and et me know if it works.


Top
 Profile  
 
 Post subject: Re: Infinispan programatic configuration
PostPosted: Thu Dec 08, 2016 8:52 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2511
Location: Third rock from the Sun
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-services

This is the source code of the *default* implementation of such Service, but you can provide your own:
- https://github.com/infinispan/infinispa ... rvice.java

This is the "very complex" interface that you'll have to implement:
- https://github.com/infinispan/infinispa ... rvice.java

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.