public class StoreObjectAccessorLocking extends java.lang.Object implements PersistenceObjectStore.StoreObjectAccessorWithLock
PersistenceObjectStore.StoreObjectAccessor 
 in a guarded read-write context such that callers will be blocked if another thread
 is accessing the object in an incompatible way (e.g. trying to read when someone is writing).
 See ReadWriteLock.
 This has no visibility or control over other access to the delegate or underlying object, of course. It can only affect callers coming through this wrapper instance. Thus callers must share instances of this class for a given item.
 No locking is done with respect to getLastModifiedDate().
| Constructor and Description | 
|---|
| StoreObjectAccessorLocking(PersistenceObjectStore.StoreObjectAccessor delegate) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | append(java.lang.String val) | 
| void | delete() | 
| boolean | exists() | 
| java.lang.String | get()gets the object, or null if not found | 
| java.util.Date | getLastModifiedDate()last modified date, null if not supported or does not exist | 
| java.util.concurrent.locks.ReadWriteLock | getLockObject()returns the underlying lock in case callers need more complex synchronization control | 
| void | put(java.lang.String val) | 
| java.lang.String | toString() | 
| void | waitForCurrentWrites(Duration timeout)waits for all currently scheduled write lock operations (puts, appends, and deletes) to complete;
 but does not wait on or prevent subsequent modifications. | 
public StoreObjectAccessorLocking(PersistenceObjectStore.StoreObjectAccessor delegate)
public java.lang.String get()
PersistenceObjectStore.StoreObjectAccessorget in interface PersistenceObjectStore.StoreObjectAccessorpublic boolean exists()
exists in interface PersistenceObjectStore.StoreObjectAccessorpublic void put(java.lang.String val)
put in interface PersistenceObjectStore.StoreObjectAccessorpublic void append(java.lang.String val)
append in interface PersistenceObjectStore.StoreObjectAccessorpublic void delete()
delete in interface PersistenceObjectStore.StoreObjectAccessorpublic void waitForCurrentWrites(Duration timeout) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
PersistenceObjectStore.StoreObjectAccessorWithLock 
 for more complex uses, readers should getLockObject().readLock().lockInterruptibly() 
 and ensure they subsequently unlock() it of course. see PersistenceObjectStore.StoreObjectAccessorWithLock.getLockObject().
waitForCurrentWrites in interface PersistenceObjectStore.StoreObjectAccessorWithLockjava.lang.InterruptedExceptionjava.util.concurrent.TimeoutExceptionpublic java.util.Date getLastModifiedDate()
PersistenceObjectStore.StoreObjectAccessorgetLastModifiedDate in interface PersistenceObjectStore.StoreObjectAccessorpublic java.util.concurrent.locks.ReadWriteLock getLockObject()
PersistenceObjectStore.StoreObjectAccessorWithLockgetLockObject in interface PersistenceObjectStore.StoreObjectAccessorWithLockpublic java.lang.String toString()
toString in class java.lang.Object