/** Generates NodeAdded notifications for all nodes of the tree. This is called whenever the tree is initially retrieved (state transfer) */ void notifyAllNodesCreated(Node curr) { Node n; Map children; if(curr == null) return; notifyNodeAdded(curr.fqn); if((children=curr.getChildren()) != null) { for(Iterator it=children.values().iterator(); it.hasNext();) { n=(Node)it.next(); notifyAllNodesCreated(n); } } }
public void setState(InputStream istream) throws Exception { Object obj=Util.objectFromStream(new DataInputStream(istream)); root=(Node)((Node)obj).clone(); notifyAllNodesCreated(root); }
/** Generates NodeAdded notifications for all nodes of the tree. This is called whenever the tree is initially retrieved (state transfer) */ void notifyAllNodesCreated(Node curr) { Node n; Map children; if(curr == null) return; notifyNodeAdded(curr.fqn); if((children=curr.getChildren()) != null) { for(Iterator it=children.values().iterator(); it.hasNext();) { n=(Node)it.next(); notifyAllNodesCreated(n); } } }
/** Generates NodeAdded notifications for all nodes of the tree. This is called whenever the tree is initially retrieved (state transfer) */ void notifyAllNodesCreated(Node curr) { Node n; Map children; if(curr == null) return; notifyNodeAdded(curr.fqn); if((children=curr.getChildren()) != null) { for(Iterator it=children.values().iterator(); it.hasNext();) { n=(Node)it.next(); notifyAllNodesCreated(n); } } }
public void setState(InputStream istream) throws Exception { Object obj=Util.objectFromStream(new DataInputStream(istream)); root=(Node)((Node)obj).clone(); notifyAllNodesCreated(root); }
/** Set the cache (tree) to this value */ public void setState(byte[] new_state) { Node new_root=null; Object obj; if(new_state == null) { if(log.isInfoEnabled()) log.info("new cache is null"); return; } try { obj=Util.objectFromByteBuffer(new_state); new_root=(Node)((Node)obj).clone(); root=new_root; notifyAllNodesCreated(root); } catch(Throwable ex) { if(log.isErrorEnabled()) log.error("could not set cache: " + ex); } }