tes with default settings and starts the cache Cache cache = DefaultCacheFactory.getInstance().createCache(); Fqn personRecords = Fqn.fromString("/org/mycompany/personRecords");
Node rootNode = cache.getRoot(); Node personRecordsNode = rootNode.addChild(personRecords);
// now add some person records. Fqn peterGriffin = Fqn.fromString("/peterGriffin"); Fqn stewieGriffin = Fqn.fromString("/stewieGriffin");
// the addChild() API uses relative Fqns Node peter = personRecordsNode.addChild(peterGriffin); Node stewie = personRecordsNode.addChild(stewieGriffin);
peter.put("name", "Peter Griffin"); peter.put("ageGroup", "MidLifeCrisis"); peter.put("homicidal", Boolean.FALSE);
stewie.put("name", "Stewie Griffin"); stewie.put("ageGroup", "Infant"); stewie.put("homicidal", Boolean.TRUE);
peter.getFqn().toString(); // will print out /org/mycompany/personRecords/peterGriffin stewie.getFqn().toString(); // will print out /org/mycompany/personRecords/stewieGriffin
peter.getFqn().getParent().equals(stewie.getFqn().getParent()); // will return true
For more information, please read the JBoss Cache user guide and tutorial, available on
the JBoss Cache documentation site, and look through the examples
shipped with the JBoss Cache distribution.
@author
Manik Surtani (manik AT jboss DOT org)
@see Node
@see CacheFactory
@since 2.0.0