So you're saying that TreeCache.get(Fqn) is not safe to be used at all?

In my case I need an efficient and safe way to walk through the tree. My 
scenario is that given a starting node, I then need to do a depth first walk 
through the tree. I need to acquire read locks on any/all nodes I visit, but 
don't need to track visitation (I've worked around my original issue by making 
my custom eviction policy a little smarter).

Can you advise then on the most efficient (safe) way to do this? I see how I 
could use TreeCache.getChildrenNames(Fqn) but this seems pretty inefficient as 
each call in turn uses findNode(Fqn) which walks through the tree from the 
root. Since my tree is pretty deep and wide, that spells trouble.

Is there a way that I can do the locking myself by using one of Node's locking 
methods?


Finally, aAre there any plans to refactor out the truly public methods of 
TreeCache into an interface? This would certainly help useability and encourage 
us users to stay away from unsafe methods. You could then have a single base 
implementation providing the additional internal helper methods. If you then 
have to do some funky casting internally that breaks the interface 
encapsulation then that is far preferable to leaving non-safe methods out there 
that will go away in the future. 

Another suggestion would be to use the Javadoc @exclude tag on the non-public 
methods so they don't get included in the javadocs.


Thanks,

Brian.

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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to