-
Enhancement
-
Resolution: Cannot Reproduce
-
Optional
-
None
-
5.0.0.CR8, 5.0.0.FINAL, 5.1.0.FINAL
-
None
I'm trying to get the CDI examples to work on an app. so I've created this config:
@Produces
@ApplicationScoped
@OverrideDefault
public EmbeddedCacheManager getCacheManager()
BTW, trying to use configuration and @Infinispan with this I get an error when CacheManager tries to get the cache, I've discussed it at http://community.jboss.org/thread/171005?tstart=0
Well, my scenario has 2 apps one on each node. So in one node I put a value in the distributed cache, and I expect to receive an event on the other node.
My problem is that the events for a cache are only hooked when the cache is first accessed (According to CacheManager:getAdvancedCache).
So, in my second ear, if there's no "warm-up" of the cache, the events do not get hooked and I don't get any notification.
So I tried to use a Singleton:
@Singleton
@Startup
public class CacheWarmupBean(){
@Inject Cache<String,String> cache;
@PostConstruct
void warm(){
cache.getCacheName();
}
}
Problem is that the bean gets started before the extension, and no target is found for the cache.
I wonder, is it possible to either warmup the cache on a different way or hook the events?