当前页面: 
在线文档首页 > 
JBoss 4.0.1 sp1 Cache API Documentation 英文版文档
ReadWriteLockWithUpgrade (JBossCache API) - JBoss 4.0.1 sp1 Cache API Documentation 英文版文档
org.jboss.cache.lock
Class ReadWriteLockWithUpgrade
java.lang.Object
   org.jboss.cache.lock.ReadWriteLockWithUpgrade
org.jboss.cache.lock.ReadWriteLockWithUpgrade
- All Implemented Interfaces: 
- EDU.oswego.cs.dl.util.concurrent.ReadWriteLock
- Direct Known Subclasses: 
- NonBlockingWriterLock
- public class ReadWriteLockWithUpgrade- extends Object- implements EDU.oswego.cs.dl.util.concurrent.ReadWriteLock
 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
activeReaders_
protected long activeReaders_
activeWriter_
protected Thread activeWriter_
waitingReaders_
protected long waitingReaders_
waitingWriters_
protected long waitingWriters_
sem_
protected EDU.oswego.cs.dl.util.concurrent.Semaphore sem_
waitingUpgrader_
protected long waitingUpgrader_
upgraderLocal_
protected ThreadLocal upgraderLocal_
dummy_
protected static final Object dummy_
readerLock_
protected final ReadWriteLockWithUpgrade.ReaderLock readerLock_
writerLock_
protected final ReadWriteLockWithUpgrade.WriterLock writerLock_
log_
protected static org.jboss.logging.Logger log_
ReadWriteLockWithUpgrade
public ReadWriteLockWithUpgrade()
writeLock
public EDU.oswego.cs.dl.util.concurrent.Sync writeLock()
- 
- Specified by:
- writeLockin interface- EDU.oswego.cs.dl.util.concurrent.ReadWriteLock
 
- 
 
readLock
public EDU.oswego.cs.dl.util.concurrent.Sync readLock()
- 
- Specified by:
- readLockin interface- EDU.oswego.cs.dl.util.concurrent.ReadWriteLock
 
- 
 
upgradeLockAttempt
public EDU.oswego.cs.dl.util.concurrent.Sync upgradeLockAttempt(long msecs)
                                                         throws UpgradeException
- Attempt to obtain an upgrade to writer lock. If successful, the read lock is upgraded to
 write lock. If fails, the owner retains the read lock.
 
- 
 
- 
- Parameters:
- msecs- Time to wait in millisecons.
- Returns:
- Sync object. Null if not successful or timeout.
- Throws:
- UpgradeException
 
changeLock
protected EDU.oswego.cs.dl.util.concurrent.Sync changeLock()
- 
 
- 
 
cancelledWaitingReader
protected void cancelledWaitingReader()
- 
 
- 
 
cancelledWaitingWriter
protected void cancelledWaitingWriter()
- 
 
- 
 
allowReader
protected boolean allowReader()
- Override this method to change to reader preference *
 
- 
 
- 
 
startRead
protected boolean startRead()
- 
 
- 
 
startWrite
protected boolean startWrite()
- 
 
- 
 
startReadFromNewReader
protected boolean startReadFromNewReader()
- 
 
- 
 
startWriteFromNewWriter
protected boolean startWriteFromNewWriter()
- 
 
- 
 
startReadFromWaitingReader
protected boolean startReadFromWaitingReader()
- 
 
- 
 
startWriteFromWaitingWriter
protected boolean startWriteFromWaitingWriter()
- 
 
- 
 
endRead
protected ReadWriteLockWithUpgrade.Signaller endRead()
- Called upon termination of a read.
 Returns the object to signal to wake up a waiter, or null if no such
 
- 
 
- 
 
endWrite
protected ReadWriteLockWithUpgrade.Signaller endWrite()
- Called upon termination of a write.
 Returns the object to signal to wake up a waiter, or null if no such
 
- 
 
- 
 
log
protected static void log(String str)
- 
 
- 
 
      
      
        Copyright © 2002 JBoss Group, LLC. All Rights Reserved.