|
lombok-pg - | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||
@Target(value=METHOD) @Retention(value=SOURCE) public @interface Await
Lock Conditions
void methodAnnotatedWithAwait() throws java.lang.InterruptedException {
this.<LOCK_NAME>.lock();
try {
while (this.<CONDITION_METHOD>()) {
this.<CONDITION_NAME>.await();
}
// method body
} finally {
this.<LOCK_NAME>.unlock();
}
}
| Required Element Summary | |
|---|---|
String |
conditionMethod
Method to verify if the condition is met. |
String |
conditionName
Name of the condition. |
| Optional Element Summary | |
|---|---|
String |
lockName
Name of the lock, default is $<CONDITION_NAME>Lock. |
Position |
pos
Specifies the place to put the await-block, default is BEFORE. |
| Element Detail |
|---|
public abstract String conditionName
If no condition with the specified name exists a new Condition will
be created, using this name.
public abstract String conditionMethod
The method must return a boolean and may not require any parameters.
public abstract Position pos
BEFORE.
Supported positions:
public abstract String lockName
$<CONDITION_NAME>Lock.
If no lock with the specified name exists a new Lock will be created,
using this name.
|
lombok-pg - | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||