org.jboss.cache.lock
Class LockManagerImpl

java.lang.Object
  extended byorg.jboss.cache.lock.LockManagerImpl
All Implemented Interfaces:
LockManager (src)

public class LockManagerImpl
extends java.lang.Object
implements LockManager (src)


Field Summary
protected  boolean dirty_reads_allowed
           
 
Constructor Summary
LockManagerImpl()
           
 
Method Summary
 boolean getDirtyReadsAllowed()
          Can we read values changed in another (uncommitted) transaction ? If true we can have read-locks; otherwise only write-locks will be acquired
 void getReadLock(TreeCache (src)  cache, java.lang.String fqn, long timeout)
          Acquires a read lock.
 void getWriteLock(TreeCache (src)  cache, java.lang.String fqn, long timeout)
          Acquires a write-lock.
 void releaseLock(java.lang.String fqn, boolean release_children)
           
 void setDirtyReadsAllowed(boolean flag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dirty_reads_allowed

protected boolean dirty_reads_allowed
Constructor Detail

LockManagerImpl

public LockManagerImpl()
Method Detail

getDirtyReadsAllowed

public boolean getDirtyReadsAllowed()
Description copied from interface: LockManager (src)
Can we read values changed in another (uncommitted) transaction ? If true we can have read-locks; otherwise only write-locks will be acquired

Specified by:
getDirtyReadsAllowed in interface LockManager (src)

setDirtyReadsAllowed

public void setDirtyReadsAllowed(boolean flag)
Specified by:
setDirtyReadsAllowed in interface LockManager (src)

getReadLock

public void getReadLock(TreeCache (src)  cache,
                        java.lang.String fqn,
                        long timeout)
                 throws TimeoutException (src) 
Description copied from interface: LockManager (src)
Acquires a read lock. If the lock cannot be acquired within the timeout, a TimeoutExeption will be thrown. If the current thread already owns the read-lock, or owns the write-lock, this will succeed.

Specified by:
getReadLock in interface LockManager (src)
Parameters:
cache -
fqn -
timeout -
Throws:
TimeoutException (src)

getWriteLock

public void getWriteLock(TreeCache (src)  cache,
                         java.lang.String fqn,
                         long timeout)
                  throws TimeoutException (src) ,
                         UpgradeException (src) 
Description copied from interface: LockManager (src)
Acquires a write-lock. If the lock cannot be acquired within the timeout, a TimeoutExeption will be thrown. If the current thread already owns the write-lock, this will succeed. If the current thread own the read-lock, it will try to upgrade the read-lock to write-lock status. If this fails, an UpgradeException will be thrown.

Specified by:
getWriteLock in interface LockManager (src)
Parameters:
cache -
fqn -
timeout -
Throws:
TimeoutException (src)
UpgradeException (src)

releaseLock

public void releaseLock(java.lang.String fqn,
                        boolean release_children)
Specified by:
releaseLock in interface LockManager (src)