public void getState(OutputStream ostream) throws Exception { Util.objectToStream(root.clone(), new DataOutputStream(ostream)); }
public void setState(InputStream istream) throws Exception { Object obj=Util.objectFromStream(new DataInputStream(istream)); root=(Node)((Node)obj).clone(); notifyAllNodesCreated(root); }
/** Return a copy of the current cache (tree) */ public byte[] getState() { try { return Util.objectToByteBuffer(root.clone()); } catch(Throwable ex) { if(log.isErrorEnabled()) log.error("exception returning cache: " + ex); return null; } }
/** 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); } }
public void getState(OutputStream ostream) throws Exception { Util.objectToStream(root.clone(), new DataOutputStream(ostream)); }
public Object clone() throws CloneNotSupportedException { Node n=new Node(name, fqn, parent != null? (Node)parent.clone() : null, data); if(children != null) n.children=(TreeMap)children.clone(); return n; }
public void setState(InputStream istream) throws Exception { Object obj=Util.objectFromStream(new DataInputStream(istream)); root=(Node)((Node)obj).clone(); notifyAllNodesCreated(root); }
public Object clone() throws CloneNotSupportedException { Node n=new Node(name, fqn, parent != null? (Node)parent.clone() : null, data); if(children != null) n.children=(TreeMap)children.clone(); return n; }
public Object clone() throws CloneNotSupportedException { Node n=new Node(name, fqn, parent != null? (Node)parent.clone() : null, data); if(children != null) n.children=(TreeMap)children.clone(); return n; }