3 Replies Latest reply on Oct 27, 2006 5:50 AM by ben.wang

    POjoCache-Internal field modification

    sushajoy

      Hi,
      I am using cache1 and cache2, the updations in cache1 are replicated correctly to cache2. But my requirement is to know about this pojo field modifications in cache2. I can't catch out it. How i can notify about the modifications in cache2 ??

        • 1. Re: POjoCache-Internal field modification

          Currently there is really no good way to detect field modification for remote node. But I have scheduled this feature for 2.1 release since it requires some form of RPC propogation of events. See this Jira:

          http://jira.jboss.com/jira/browse/JBCACHE-742

          Meanwhile, to get around this, the closest thing is to subscribe the underlying TreeCache event and decode it yourself.

          • 2. Re: POjoCache-Internal field modification
            sushajoy

            Ben,

            Can you please guide me to get around this.
            How should i subscribe for the event ??

            Thanks
            Susha

            • 3. Re: POjoCache-Internal field modification

              Take a look at TreeCacheListener interface and here is a code snippet:

              MyTreeCacheListener listener = new MyTreeCacheLister();
              cache.addTreeCacheListener(listener);
              cache.start();
              ...
              


              Only caveat is that the notification is on the node level (while fields are stored in the attribute inside the node map). So when a node is modified, you don't know exactly which one except that some attributes inside this node has been modified.

              Hope this help.