ojb.odmg.locking
Class LockEntry

java.lang.Object
  |
  +--ojb.odmg.locking.LockEntry
All Implemented Interfaces:
java.io.Serializable

public class LockEntry
extends java.lang.Object
implements java.io.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
static int LOCK_READ
          marks a Read Lock.
static int LOCK_WRITE
          marks a Write Lock.
 
Constructor Summary
LockEntry()
          default constructor
LockEntry(java.lang.String oidString, java.lang.String transactionId)
          build a LockEntry from an OID and a Transaction ID
LockEntry(java.lang.String oidString, java.lang.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.
 java.lang.String getOidString()
          returns the OID STring of the locked object.
 long getTimestamp()
          returns the timestamp of the acqusition of the lock.
 java.lang.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 setLockType(int locktype)
          sets the locktype of this lockentry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCK_READ

public static int LOCK_READ
marks a Read Lock.


LOCK_WRITE

public static int LOCK_WRITE
marks a Write Lock.

Constructor Detail

LockEntry

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


LockEntry

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


LockEntry

public LockEntry()
default constructor

Method Detail

getOidString

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


getTransactionId

public java.lang.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.



Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04