public class LockPolicy
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
static LockPolicy | 
DEFAULT  | 
| Constructor and Description | 
|---|
LockPolicy(boolean retryPreferred,
          WriteLockRequestListener lockListener)  | 
| Modifier and Type | Method and Description | 
|---|---|
WriteLockRequestListener | 
getLockListener()
Gets a  
WriteLockRequestListener that listens to write lock
 requests from other threads while a read lock is held. | 
boolean | 
isRetryPreferred()
Gets whether forcing a retry by throwing InterruptedException is preferred
 to blocking on an unavailable lock. 
 | 
public static LockPolicy DEFAULT
public LockPolicy(boolean retryPreferred,
                  WriteLockRequestListener lockListener)
retryPreferred - Whether a retry later by throwing InterruptedException
                       is preferred to blocking.lockListener - A listener for write lock requests from other threads.public boolean isRetryPreferred()
public WriteLockRequestListener getLockListener()
WriteLockRequestListener that listens to write lock
 requests from other threads while a read lock is held.