-
1. Re: TreeCacheListerner use case question ?
belaban Sep 24, 2005 11:18 AM (in response to ctof)Put the callback on nodeModified() not nodeCreated()
-
2. Re: TreeCacheListerner use case question ?
ctof Sep 25, 2005 4:24 PM (in response to ctof)yes, i have read the code of TreeCache and TreeCacheAop
and i have implemented the nodeModify callBack
and this method is called many time for the same modification.
another pb is we can not make the difference between node which has been created (modified the first time) and another modification.
it seems this state comes from the interceptor pattern (and specially from the interceptor which create a node if not exists (before setting the data of the node) and from the method putObject which begin bu creating a node with a dummy map.
My need is to have a callback when a data object for a given fqn is created (node not exist or node data is null) and a callback when a data for a node is modified)
i suggest to add two new callback for TreeCacheListner:
newData(Fqn fqn, Serializable data);
updateData(Fqn fqn, Serializable data);
this methods could be called in the _put(..., Object data, ...);
and only one time.
Is this modifcation make sens ?
Tomorrow i patch my local cvs to see if i can works.
Thx
Christophe