org.apache.ojb.odmg.locking
Class LockEntry

java.lang.Object
  extended by org.apache.ojb.odmg.locking.LockEntry
All Implemented Interfaces:
Serializable

public class LockEntry
extends Object
implements Serializable

a persistent entry for locks. All locks that are hold from transaction on objects are represented by a LockENtry and made persistent to the database.

Author:
Thomas Mahler
See Also:
Serialized Form

Field Summary
private  int isolationLevel
          the isolationlevel for this lock.
static int LOCK_READ
          marks a Read Lock.
static int LOCK_WRITE
          marks a Write Lock.
private  int lockType
          marks if this is a read or a write lock.
private  String oidString
          the unique OID of the object to be locked.
(package private) static long serialVersionUID
           
private  long timestamp
          the timestamp marking the time of acquisition of this lock
private  String transactionId
          the GUID of the transaction that holds the lock
 
Constructor Summary
LockEntry()
          default constructor
LockEntry(String oidString, String transactionId)
          build a LockEntry from an OID and a Transaction ID
LockEntry(String oidString, String transactionId, long timestamp, int isolationLevel, int lockType)
          Multiargument constructor for fast loading of LockEntries by OJB.
 
Method Summary
 int getIsolationLevel()
          returns the isolation level of this lock
 int getLockType()
          returns the locktype of this lock.
 String getOidString()
          returns the OID STring of the locked object.
 long getTimestamp()
          returns the timestamp of the acqusition of the lock.
 String getTransactionId()
          returns the GUID string of the locking transaction.
 boolean isOwnedBy(TransactionImpl tx)
          returns true if this lock is owned by transaction tx, else false.
 void setIsolationLevel(int isolationLevel)
          Sets the isolationLevel.
 void setLockType(int locktype)
          sets the locktype of this lockentry.
 void setOidString(String oidString)
          Sets the oidString.
 void setTimestamp(long timestamp)
          Sets the timestamp.
 void setTransactionId(String transactionId)
          Sets the transactionId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

LOCK_READ

public static int LOCK_READ
marks a Read Lock.


LOCK_WRITE

public static int LOCK_WRITE
marks a Write Lock.


oidString

private String oidString
the unique OID of the object to be locked.


transactionId

private String transactionId
the GUID of the transaction that holds the lock


timestamp

private long timestamp
the timestamp marking the time of acquisition of this lock


isolationLevel

private int isolationLevel
the isolationlevel for this lock.


lockType

private int lockType
marks if this is a read or a write lock. LOCK_READ = 0; LOCK_WRITE = 1;

Constructor Detail

LockEntry

public LockEntry(String oidString,
                 String transactionId,
                 long timestamp,
                 int isolationLevel,
                 int lockType)
Multiargument constructor for fast loading of LockEntries by OJB.


LockEntry

public LockEntry(String oidString,
                 String transactionId)
build a LockEntry from an OID and a Transaction ID


LockEntry

public LockEntry()
default constructor

Method Detail

getOidString

public String getOidString()
returns the OID STring of the locked object.


getTransactionId

public String getTransactionId()
returns the GUID string of the locking transaction.


getTimestamp

public long getTimestamp()
returns the timestamp of the acqusition of the lock.


getIsolationLevel

public int getIsolationLevel()
returns the isolation level of this lock


getLockType

public int getLockType()
returns the locktype of this lock.

Returns:
LOCK_READ if lock is a readlock, LOCK_WRITE if lock is a Write lock.

setLockType

public void setLockType(int locktype)
sets the locktype of this lockentry.

Parameters:
locktype - LOCK_READ for read, LOCK_WRITE for write lock.

isOwnedBy

public boolean isOwnedBy(TransactionImpl tx)
returns true if this lock is owned by transaction tx, else false.


setIsolationLevel

public void setIsolationLevel(int isolationLevel)
Sets the isolationLevel.

Parameters:
isolationLevel - The isolationLevel to set

setOidString

public void setOidString(String oidString)
Sets the oidString.

Parameters:
oidString - The oidString to set

setTimestamp

public void setTimestamp(long timestamp)
Sets the timestamp.

Parameters:
timestamp - The timestamp to set

setTransactionId

public void setTransactionId(String transactionId)
Sets the transactionId.

Parameters:
transactionId - The transactionId to set


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.