1 7 package org.jboss.cache; 8 9 import org.jboss.cache.optimistic.DataVersion; 10 import org.jboss.cache.optimistic.DefaultDataVersion; 11 12 import java.util.Map ; 13 14 19 public class VersionedNode extends UnversionedNode 20 { 21 22 private DataVersion version; 23 24 29 private NodeSPI parent; 30 31 public VersionedNode(Object childName, Fqn fqn, NodeSPI parent, Map data, boolean mapSafe, CacheSPI cache) 32 { 33 super(childName, fqn, data, mapSafe, cache); 34 if (parent == null && !fqn.isRoot()) throw new NullPointerException ("parent"); 35 this.parent = parent; 36 this.version = DefaultDataVersion.ZERO; 37 } 38 39 public VersionedNode(Object childName, Fqn fqn, NodeSPI parent, Map data, CacheSPI cache) 40 { 41 this(childName, fqn, parent, data, false, cache); 42 } 43 44 49 public DataVersion getVersion() 50 { 51 return version; 52 } 53 54 57 public NodeSPI getParent() 58 { 59 return parent; 60 } 61 62 67 public void setVersion(DataVersion version) 68 { 69 this.version = version; 70 } 71 } 72 | Popular Tags |