O - The type of the object to protect.public static class LockingVisitors.StampedLockVisitor<O> extends LockingVisitors.LockVisitor<O,StampedLock>
StampedLock 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.StampedLockVisitor.Builder<O>
Builds
LockingVisitors.LockVisitor instances. |
LockingVisitors.LockVisitor.LVBuilder<O,L,B extends LockingVisitors.LockVisitor.LVBuilder<O,L,B>>| Modifier | Constructor and Description |
|---|---|
protected |
StampedLockVisitor(O object,
StampedLock stampedLock)
Creates a new instance with the given object and lock.
|
| Modifier and Type | Method and Description |
|---|---|
static <O> LockingVisitors.StampedLockVisitor.Builder<O> |
builder()
Creates a new builder.
|
acceptReadLocked, acceptWriteLocked, applyReadLocked, applyWriteLocked, getLock, getObject, lockAcceptUnlock, lockApplyUnlockprotected StampedLockVisitor(O object, StampedLock stampedLock)
object - The object to protect. The caller is supposed to drop all references to the locked object.stampedLock - the lock to use.LockingVisitorspublic static <O> LockingVisitors.StampedLockVisitor.Builder<O> builder()
O - the wrapped object type.Copyright © 2001–2025 The Apache Software Foundation. All rights reserved.