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

LockManagerImpl (JBossCache API) - JBoss 4.0.1 sp1 Cache API Documentation 英文版文档


org.jboss.cache.lock
Class LockManagerImpl

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

public class LockManagerImpl
extends Object
implements LockManager

Version:
$Revision: 1.2 $
Author:
Bela Ban Apr 10, 2003

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

setDirtyReadsAllowed

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

getReadLock

public void getReadLock(TreeCache cache,
                        String fqn,
                        long timeout)
                 throws TimeoutException
Description copied from interface: LockManager
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
Parameters:
cache -
fqn -
timeout -
Throws:
TimeoutException

getWriteLock

public void getWriteLock(TreeCache cache,
                         String fqn,
                         long timeout)
                  throws TimeoutException,
                         UpgradeException
Description copied from interface: LockManager
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
Parameters:
cache -
fqn -
timeout -
Throws:
TimeoutException
UpgradeException

releaseLock

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


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