org.jboss.cache.lock
Interface LockManager

All Known Implementing Classes:
LockManagerImpl (src)

public interface LockManager

Interface for acquising and releasing locks on nodes of the cache. An implementation knows the cache and how to acquire locks on nodes.


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)
           
 

Method Detail

getDirtyReadsAllowed

public 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


setDirtyReadsAllowed

public void setDirtyReadsAllowed(boolean flag)

getReadLock

public void getReadLock(TreeCache (src)  cache,
                        java.lang.String fqn,
                        long timeout)
                 throws TimeoutException (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.

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) 
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.

Parameters:
cache -
fqn -
timeout -
Throws:
TimeoutException (src)
UpgradeException (src)

releaseLock

public void releaseLock(java.lang.String fqn,
                        boolean release_children)