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 bynet.sf.ehcache.distribution.RMICacheReplicatorFactory
and which one will be used finally?