2 Replies Latest reply on Oct 22, 2007 3:07 AM by Sebastien Pennec

    How TreeCacheListener works

    Sebastien Pennec Newbie


      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:


      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:


      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!