Annotation Interface CoherenceEventListener


@Target({METHOD,ANNOTATION_TYPE}) @Retention(RUNTIME) @Documented public @interface CoherenceEventListener

A listener annotation that allows for the subscription of Coherence events.

The method will ultimately be wrapped in either an EventInterceptor or a MapListener. Various qualifier annotations can also be applied to further qualify the types of events and the target event source for a specific listener method. Listener methods can have any name but must take a single parameter that extends either Event or MapEvent and return void.

For example:

The following method will receive a CacheLifecycleEvent event every time a map or cache is created or destroyed.


  @CoherenceEventListener
   public void onEvent(CacheLifecycleEvent event) {
   }
 
Since:
3.0
Author:
Gunnar Hillert