Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

cacheManagerEventListenerFactory vs cacheEventListenerFactory

$
0
0

I am EhCache RMI synchronous replication and configured my ehcache.xml as shown below. (please note that I am overriding most of classes and defining properties like "rmiURLs", "host" etc. in there from properties file, so you will not see those properties defined in my ehcache.xml but all properties are used correctly, unused ports are specified and they are different for each cache).

But this configuration doesn't replicate the cache, I see no error in logs. If I update the cache then I can see the changes in local cache but it is not getting replicated.

I figured that I need to specify <cacheManagerEventListenerFactory class="net.sf.ehcache.event.TestCacheManagerEventListenerFactory" /> otherwise there will be no listeners because if no class is specified, no listener is created. There is no default here.

But my doubt is that this tag <cacheEventListenerFactory class= .... specifies a net.sf.ehcache.distribution.RMICacheReplicatorFactory and which creates a net.sf.ehcache.distribution.RMISynchronousCacheReplicator.RMISynchronousCacheReplicator(boolean, boolean, boolean, boolean, boolean) (if I am using a synchronous replication). Now, RMISynchronousCacheReplicator extends net.sf.ehcache.event.CacheEventListener which is an cache listener.

So,

  • Why I again need to use <cacheManagerEventListenerFactory .... to specify a listener?
  • If I specify another listener using <cacheManagerEventListenerFactory .... then what will happen to cache listener created by net.sf.ehcache.distribution.RMICacheReplicatorFactory and which one will be used finally?

Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>