1 /* 2 * JBoss, Home of Professional Open Source 3 * 4 * Distributable under LGPL license. 5 * See terms of license at gnu.org. 6 */ 7 package org.jboss.cache.optimistic; 8 9 import java.io.Serializable; 10 11 /** 12 * When versioning data nodes in optimistic locking, a DataVersion is assigned 13 * to each node. Versions need to implement the {@link #newerThan} method so 14 * they can be compared during the validation phase upon commit. 15 * <p/> 16 * It is recommended that implementations implement {@link java.io.Externalizable} and make use 17 * of a good marshalling/unmarshalling mechanism for the sake of efficiency, as these objects are 18 * frequently serialized to be replicated across the wire. 19 * 20 * @author <a HREF="mailto:manik@jboss.org">Manik Surtani (manik@jboss.org)</a> 21 */ 22 public interface DataVersion extends Serializable 23 { 24 /** 25 * Returns true if this is a newer version than <code>other</code>. 26 */ 27 public boolean newerThan(DataVersion other); 28 } 29