@Retention(value=RUNTIME)
@Inherited
@Target(value={METHOD,ANNOTATION_TYPE})
public @interface Synchronized
A handler marked with this annotation is guaranteed to be invoked in a thread-safe manner, that is, no
other running message publication will be able to invoke this or any other synchronized handler of the same
listener until the handler completed. It is equal to wrapping the handler code in a synchronized{} block.
This feature will reduce performance of message publication. Try to avoid shared mutable state whenever possible
and use immutable data instead.
Note: Unsynchronized handlers may still be invoked concurrently with synchronized ones
- Author:
- bennidi
Date: 3/31/13