[jboss-dev-forums] [Design of JBossCache] - Re: PojoInstance: ref count & notification
supi
do-not-reply at jboss.com
Tue Apr 10 10:28:09 EDT 2007
Unfortunately, I don't have CVS access right now, and not much time either.
But to clarify (I don't think it's the serialization issue):
1) I'm not talking about attach/detach notifications provided by PojoCacheListener because they don't currently work for remote changes and also don't provide all the information I need. Right now, I'm building my own POJO notification adapter. This is simply a stateful CacheListener (not a PojoCacheListener) that converts pre and post node modified notifications into attach/modify/detach (I like the concept), and whether this is an initial attach or the last detach.
2) For this to work, PRE must really be PRE, especially in the case of reference counts. If you do:
| int count = pojoInstance.incrementRefCount(referencingFqn);
| // need to update it.
| put(originalFqn, PojoInstance.KEY, pojoInstance);
|
the local pojoInstance object is already changed before you issue the put (incrementRefCount not intercepted).
To check this, you can simply add a cache listener to a pojo cache's base cache and print data of local node modified events. By cloning the object, node modified (PRE) actually contains the ref count before changing it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036000#4036000
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036000
More information about the jboss-dev-forums
mailing list