[jboss-user] [JBossCache] - How TreeCacheListener works

spennec do-not-reply at jboss.com
Tue Aug 28 09:24:40 EDT 2007


Hello,

I'm trying to use a TreeCacheListener in the following situation:

- TreeCache version: 1.4.1 SP4
- There is a cluster with two members
- TreeCache is in mode INVALIDATION_SYNC and OPTIMISTIC locking scheme

When a piece of data is modified, I remove it from the cache. I expect the corresponding data to be invalidated in the other cluster member.

What I would like to do is recieve a call in the listener on cluster member A (and optionnaly B) when some piece of data is removed from cluster member B. Is that possible?

To register the listener, I've just created a subclass of AbstractTreeCacheListener, and called the following method, before calling the start() method: 

treeCache.addTreeCacheListener(listener);

At this point, I've added logs in several methods, and some of them, that I expect to be called, remain silent. Here are the methods I've implemented, and only filled with logs:


  | nodeRemoved
  | nodeRemove
  | cacheStarted
  | cacheStopped
  | nodeEvict
  | nodeEvicted
  | 
  | 
  | The methods cacheStarted and cacheStopped are called. But the other are never called, on any cluster member, even when I call remove() on the treeCache to invalidate some data.
  | 
  | Am I not understanding the goal of the TreeCacheListener? Or did I do something wrong with the setup?
  | 
  | Thanks a lot for your help!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078755#4078755

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078755



More information about the jboss-user mailing list