O - The type of the object to protect.public static class LockingVisitors.ReadWriteLockVisitor<O> extends LockingVisitors.LockVisitor<O,ReadWriteLock>
ReadWriteLock and object to protect. To access the object, use the methods LockingVisitors.LockVisitor.acceptReadLocked(FailableConsumer),
LockingVisitors.LockVisitor.acceptWriteLocked(FailableConsumer), LockingVisitors.LockVisitor.applyReadLocked(FailableFunction), and LockingVisitors.LockVisitor.applyWriteLocked(FailableFunction). The visitor
holds the lock while the consumer or function is called.| Modifier and Type | Class and Description |
|---|---|
static class |
LockingVisitors.ReadWriteLockVisitor.Builder<O>
Builds
LockingVisitors.LockVisitor instances. |
LockingVisitors.LockVisitor.LVBuilder<O,L,B extends LockingVisitors.LockVisitor.LVBuilder<O,L,B>>| Modifier | Constructor and Description |
|---|---|
protected |
ReadWriteLockVisitor(O object,
ReadWriteLock readWriteLock)
Creates a new instance with the given object and lock.
|
| Modifier and Type | Method and Description |
|---|---|
static <O> LockingVisitors.ReadWriteLockVisitor.Builder<O> |
builder()
Creates a new builder.
|
acceptReadLocked, acceptWriteLocked, applyReadLocked, applyWriteLocked, getLock, getObject, lockAcceptUnlock, lockApplyUnlockprotected ReadWriteLockVisitor(O object, ReadWriteLock readWriteLock)
object - The object to protect. The caller is supposed to drop all references to the locked object.readWriteLock - the lock to use.LockingVisitorspublic static <O> LockingVisitors.ReadWriteLockVisitor.Builder<O> builder()
O - the wrapped object type.Copyright © 2001–2025 The Apache Software Foundation. All rights reserved.