lombok-pg -

lombok
Annotation Type AwaitBeforeAndSignalAfter


@Target(value=METHOD)
@Retention(value=SOURCE)
public @interface AwaitBeforeAndSignalAfter

Lock Conditions

 void methodAnnotatedWithAwait() throws java.lang.InterruptedException {
   this.<LOCK_NAME>.lock();
   try {
     while (this.<AWAIT_CONDITION_METHOD>()) {
       this.<AWAIT_CONDITION_NAME>.await();
     }
 
     // method body
 
     this.<SIGNAL_CONDITION_NAME>.signal();
   } finally {
     this.<LOCK_NAME>.unlock();
   }
 }
 
 


Required Element Summary
 String awaitConditionMethod
          Method to verify if the await-condition is met.
 String awaitConditionName
          Name of the await-condition.
 String signalConditionName
          Name of the signal-condition.
 
Optional Element Summary
 String lockName
          Name of the lock, default is $<AWAIT_CONDITION_NAME><SIGNAL_CONDITION_NAME>Lock.
 

Element Detail

signalConditionName

public abstract String signalConditionName
Name of the signal-condition.

If no condition with the specified name exists a new Condition will be created, using this name.


awaitConditionName

public abstract String awaitConditionName
Name of the await-condition.

If no condition with the specified name exists a new Condition will be created, using this name.


awaitConditionMethod

public abstract String awaitConditionMethod
Method to verify if the await-condition is met.

The method must return a boolean and may not require any parameters.

lockName

public abstract String lockName
Name of the lock, default is $<AWAIT_CONDITION_NAME><SIGNAL_CONDITION_NAME>Lock.

If no lock with the specified name exists a new Lock will be created, using this name.

Default:
""

lombok-pg -

Copyright © 2010-2011 Philipp Eichhorn, licensed under the MIT licence.