[jboss-user] [JBoss Cache: Core Edition] - Re: node.getChild() returning inconsistent results

drcallaway do-not-reply at jboss.com
Wed Jun 24 10:59:19 EDT 2009

"galder.zamarreno at jboss.com" wrote : getChild() takes the fqn of the child, it's a relative method. Root already provides the first /, so the name of the child is without that first /: content/timestamp
  | If u used Cache rather than Node, you'd do the following using the absolute path:
  | cache.getNode("/content/timestamp");

Thanks Galder. That makes sense but I'm having trouble reconciling your comments with this code right out of the JBoss Cache Users' Guide:

  |    // Let's get a hold of the root node.
  |    Node rootNode = cache.getRoot();
  |    // Remember, JBoss Cache stores data in a tree structure.
  |    // All nodes in the tree structure are identified by Fqn objects.
  |    Fqn peterGriffinFqn = Fqn.fromString("/griffin/peter");
  |    // Create a new Node
  |    Node peterGriffin = rootNode.addChild(peterGriffinFqn);

This code uses an absolute value FQN to retrieve a node directly from the root node (not from cache). Perhaps the Users' Guide is incorrect?

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

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

More information about the jboss-user mailing list