arlut.csd.ganymede
Class DBDumpLock

java.lang.Object
  |
  +--arlut.csd.ganymede.DBLock
        |
        +--arlut.csd.ganymede.DBDumpLock

class DBDumpLock
extends DBLock

DBDumpLock is a DBLock object used to lock the DBStore for the purpose of dumping the database. A DBDumpLock establish request has lower priority than DBWriteLock requests, but once a DBDumpLock establish request is submitted, no new DBWriteLock can be established until the dumping thread has completed the dump and released the lock.

DBReadLock's can be established while a DBDumpLock is active.


Field Summary
(package private) static boolean debug
           
 
Fields inherited from class arlut.csd.ganymede.DBLock
abort, baseSet, inEstablish, key, locked, lockSync
 
Constructor Summary
DBDumpLock(DBStore store)
          constructor to get a dump lock on all the object bases
DBDumpLock(DBStore store, java.util.Vector baseSet)
          constructor to get a dump lock on a subset of the object bases.
 
Method Summary
 void abort()
          Withdraw this lock.
 void establish(java.lang.Object key)
          Establish a dump lock on bases specified in this DBDumpLock's constructor.
 void release()
          Release this lock on all bases locked
 
Methods inherited from class arlut.csd.ganymede.DBLock
getKey, isLocked, isLocked, isLocked, overlaps, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

debug

static final boolean debug
Constructor Detail

DBDumpLock

public DBDumpLock(DBStore store)
constructor to get a dump lock on all the object bases

DBDumpLock

public DBDumpLock(DBStore store,
                  java.util.Vector baseSet)
constructor to get a dump lock on a subset of the object bases.
Method Detail

establish

public void establish(java.lang.Object key)
               throws java.lang.InterruptedException

Establish a dump lock on bases specified in this DBDumpLock's constructor. Can throw InterruptedException if another thread orders us to abort() while we're waiting for permission to proceed with reads on the specified baseset.

Overrides:
establish in class DBLock

release

public void release()
Release this lock on all bases locked
Overrides:
release in class DBLock

abort

public void abort()

Withdraw this lock. This method can be called by a thread to interrupt a lock establish that is blocked waiting to get access to the appropriate set of DBObjectBase objects. If this method is called while another thread is blocked in establish(), establish() will throw an InterruptedException.

Once abort() is processed, this lock may never be established. Any subsequent calls to estabish() will always throw InterruptedException.

Overrides:
abort in class DBLock