|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Documented @Retention(value=RUNTIME) @Target(value={METHOD,PARAMETER}) public @interface DistributedDynamicMutexLockKey
Annotation to declare a dynamic resolved lock key by a input parameter. For example to protect against concurrent modifications of a customer which may cause inconsistency, the customer id could be used as a potential lock key.
Optional Element Summary | |
---|---|
String |
lockKeySelectorPath
Defines a path to a class attribute or a getter method thats value should be used as the lock key. |
DistributedDynamicMutexLockKey.LockKeySelectorType |
lockKeySelectorType
Defines how the lock key selector path should be interpreted. |
int |
lockOrderNumber
If multiple locks should be done, than the lock order number (=lock priority) defines in which order the locks should be done. |
long |
maxLockWaitTime
The maximum amount of milliseconds to wait for get the mutex locked. |
int |
parameterIndex
If the annotation is used at method level, than this declares the parameter index to which it belongs. |
String |
postfix
A postfix string that should get appended to the end of the mutex lock key. |
String |
prefix
A prefix string that should get pushed before the mutex lock key. |
public abstract DistributedDynamicMutexLockKey.LockKeySelectorType lockKeySelectorType
LockKeySelectorType.NONE
which means that the
toString() method should be invoked on the parameter direct, to get the
key to lock.
public abstract String lockKeySelectorPath
LockKeySelectorType.ATTRIBUTE
. The default value is "".
public abstract int parameterIndex
public abstract String prefix
public abstract String postfix
public abstract long maxLockWaitTime
public abstract int lockOrderNumber
Integer.MAX_VALUE
. A lock order should be always
declared, as it reduces deadlock problems.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |