br.shob.storage
Class StorageLock

java.lang.Object
  |
  +--br.shob.storage.StorageLock
All Implemented Interfaces:
Serializable

public class StorageLock
extends Object
implements Serializable

Instances of StorageLock act as reentrant locks used in many storage operations. Non-reentrant locks can be created overriding the setLocker method with an empty method.

Notice that the lock synchronizes on the instance's monitor, therefore synchronizing on the lock may lead to deadlocks.

Since:
September 18, 2002
Author:
dukejeffrie
See Also:
Serialized Form

Constructor Summary
StorageLock()
          Constructor for the StorageLock object
 
Method Summary
 boolean isLocked()
          Gets the locked attribute of the StorageLock object
 void lock()
          Description of the Method
protected  void setLocker(Thread t)
          Sets the locker attribute of the StorageLock object
 void unlock()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageLock

public StorageLock()
Constructor for the StorageLock object

Method Detail

isLocked

public boolean isLocked()
Gets the locked attribute of the StorageLock object

Returns:
The locked value

lock

public void lock()
Description of the Method


unlock

public void unlock()
Description of the Method


setLocker

protected void setLocker(Thread t)
Sets the locker attribute of the StorageLock object

Parameters:
t - The new locker value