Annotation Type ListenerPriority


  • @Retention(RUNTIME)
    @Target(TYPE)
    public @interface ListenerPriority
    This annotation sets the priority of execution on BeforeEnterListeners, BeforeLeaveListeners and AfterNavigationListeners. Listeners will be sorted by their respective priority value in a descending order before they are executed. Listeners that are not annotated with @ListenerPriority have a default priority of zero.
     // will be executed first
     @ListenerPriority(5)
     class HighPriorityListener implements BeforeEnterListener {
     }
    
     // will be executed second, default priority is 0
     class YetAnotherListener implements BeforeEnterListener {
     }
    
     // will be executed third
     @ListenerPriority(-5)
     class LowPriorityListener implements BeforeEnterListener {
     }
     
    Since:
    1.0
    Author:
    Bernd Hopp
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      int value
      The priority of the annotated listener, can be any integer.
    • Element Detail

      • value

        int value
        The priority of the annotated listener, can be any integer. Larger numbers indicate higher priority.
        Returns:
        the priority-value.