/** * This generic method is called immediately before any read operation is * invoked. All generic read assertions should take place here. */ protected void beforeReadOperation() { // if a Set of reader Threads have been given, ensure the current Thread is one of them if (!sanctionedReaderThreads.isEmpty() && !sanctionedReaderThreads.contains(Thread.currentThread())) throw new IllegalStateException("DebugList detected an unexpected Thread (" + Thread.currentThread() + ") attempting to perform a read operation"); // if lock checking is enabled, ensure the current Thread holds a read or write lock before continuing if (isLockCheckingEnabled() && !debugReadWriteLock.isThreadHoldingReadOrWriteLock()) throw new IllegalStateException("DebugList detected a failure to acquire the readLock prior to a read operation"); }
/** * This generic method is called immediately before any write operation is * invoked. All generic write assertions should take place here. */ protected void beforeWriteOperation() { // if a Set of writer Threads have been given, ensure the current Thread is one of them if (!sanctionedWriterThreads.isEmpty() && !sanctionedWriterThreads.contains(Thread.currentThread())) throw new IllegalStateException("DebugList detected an unexpected Thread (" + Thread.currentThread() + ") attempting to perform a write operation"); // if lock checking is enabled, ensure the current Thread holds a write lock before continuing if (isLockCheckingEnabled() && !debugReadWriteLock.isThreadHoldingWriteLock()) throw new IllegalStateException("DebugList detected a failure to acquire the writeLock prior to a write operation"); }
/** * This generic method is called immediately before any write operation is * invoked. All generic write assertions should take place here. */ protected void beforeWriteOperation() { // if a Set of writer Threads have been given, ensure the current Thread is one of them if (!sanctionedWriterThreads.isEmpty() && !sanctionedWriterThreads.contains(Thread.currentThread())) throw new IllegalStateException("DebugList detected an unexpected Thread (" + Thread.currentThread() + ") attempting to perform a write operation"); // if lock checking is enabled, ensure the current Thread holds a write lock before continuing if (isLockCheckingEnabled() && !debugReadWriteLock.isThreadHoldingWriteLock()) throw new IllegalStateException("DebugList detected a failure to acquire the writeLock prior to a write operation"); }
/** * This generic method is called immediately before any write operation is * invoked. All generic write assertions should take place here. */ protected void beforeWriteOperation() { // if a Set of writer Threads have been given, ensure the current Thread is one of them if (!sanctionedWriterThreads.isEmpty() && !sanctionedWriterThreads.contains(Thread.currentThread())) throw new IllegalStateException("DebugList detected an unexpected Thread (" + Thread.currentThread() + ") attempting to perform a write operation"); // if lock checking is enabled, ensure the current Thread holds a write lock before continuing if (isLockCheckingEnabled() && !debugReadWriteLock.isThreadHoldingWriteLock()) throw new IllegalStateException("DebugList detected a failure to acquire the writeLock prior to a write operation"); }
/** * This generic method is called immediately before any read operation is * invoked. All generic read assertions should take place here. */ protected void beforeReadOperation() { // if a Set of reader Threads have been given, ensure the current Thread is one of them if (!sanctionedReaderThreads.isEmpty() && !sanctionedReaderThreads.contains(Thread.currentThread())) throw new IllegalStateException("DebugList detected an unexpected Thread (" + Thread.currentThread() + ") attempting to perform a read operation"); // if lock checking is enabled, ensure the current Thread holds a read or write lock before continuing if (isLockCheckingEnabled() && !debugReadWriteLock.isThreadHoldingReadOrWriteLock()) throw new IllegalStateException("DebugList detected a failure to acquire the readLock prior to a read operation"); }
/** * This generic method is called immediately before any read operation is * invoked. All generic read assertions should take place here. */ protected void beforeReadOperation() { // if a Set of reader Threads have been given, ensure the current Thread is one of them if (!sanctionedReaderThreads.isEmpty() && !sanctionedReaderThreads.contains(Thread.currentThread())) throw new IllegalStateException("DebugList detected an unexpected Thread (" + Thread.currentThread() + ") attempting to perform a read operation"); // if lock checking is enabled, ensure the current Thread holds a read or write lock before continuing if (isLockCheckingEnabled() && !debugReadWriteLock.isThreadHoldingReadOrWriteLock()) throw new IllegalStateException("DebugList detected a failure to acquire the readLock prior to a read operation"); }