站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 Cache API Documentation 英文版文档

LockManager (JBoss Cache API) - JBoss 3.2.7 Cache API Documentation 英文版文档


org.jboss.cache.lock
Interface LockManager

All Known Implementing Classes:
LockManagerImpl

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.

Version:
$Revision: 1.1.2.6 $
Author:
Bela Ban Apr 9, 2003

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 cache, String fqn, long timeout)
          Acquires a read lock.
 void getWriteLock(TreeCache cache, String fqn, long timeout)
          Acquires a write-lock.
 void releaseLock(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 cache,
                        String fqn,
                        long timeout)
                 throws TimeoutException
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

getWriteLock

public void getWriteLock(TreeCache cache,
                         String fqn,
                         long timeout)
                  throws TimeoutException,
                         UpgradeException
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
UpgradeException

releaseLock

public void releaseLock(String fqn,
                        boolean release_children)


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.