org.jboss.cache.optimistic
Class DefaultDataVersion

java.lang.Object
  extended by org.jboss.cache.optimistic.DefaultDataVersion
All Implemented Interfaces:
Serializable, DataVersion

Deprecated. this is to support a deprecated locking scheme (Optimistic Locking). Will be removed when Optimistic Locking support is removed.

@Immutable
@Deprecated
public class DefaultDataVersion
extends Object
implements DataVersion

The default implementation of a DataVersion, uses a long to compare versions. This class is immutable.

Also note that this is meant to control implicit, internal versioning. Do not attempt to instantiate or use instances of this class explicitly, via the Option.setDataVersion(DataVersion) API, as it WILL break things.

Author:
Manik Surtani (manik AT jboss DOT org)
See Also:
Serialized Form

Field Summary
static DataVersion ZERO
          Deprecated. Version zero.
 
Constructor Summary
DefaultDataVersion()
          Deprecated. Constructs with version 0.
DefaultDataVersion(long version)
          Deprecated. Constructs with a version number.
 
Method Summary
 boolean equals(Object other)
          Deprecated.  
 long getRawVersion()
          Deprecated.  
 int hashCode()
          Deprecated.  
 DataVersion increment()
          Deprecated. Returns a new DataVersion with a newer version number.
 boolean newerThan(DataVersion other)
          Deprecated. Returns true if this is a newer version than other.
 String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final DataVersion ZERO
Deprecated. 
Version zero. Assign this as the first version to your data.

Constructor Detail

DefaultDataVersion

public DefaultDataVersion()
Deprecated. 
Constructs with version 0.


DefaultDataVersion

public DefaultDataVersion(long version)
Deprecated. 
Constructs with a version number.

Method Detail

increment

public DataVersion increment()
Deprecated. 
Returns a new DataVersion with a newer version number.


newerThan

public boolean newerThan(DataVersion other)
Deprecated. 
Description copied from interface: DataVersion
Returns true if this is a newer version than other. There is no guarantee that the DataVersion passed in is of the same implementation as the current instance. The implementation will have to check for this (if necessary) and (if necessary) throw a DataVersioningException.

Specified by:
newerThan in interface DataVersion

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Deprecated. 
Overrides:
equals in class Object

hashCode

public int hashCode()
Deprecated. 
Overrides:
hashCode in class Object

getRawVersion

public long getRawVersion()
Deprecated. 


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.