Annotation Interface Observes


@Target(METHOD) @Retention(RUNTIME) public @interface Observes
Identifies callback methods in event observers.

Optional attributes are used to indicate:

  • event qualifiers (Any by default);
  • whether the successful execution of the method is Observes.Kind.critical to the client. Non critical methods may be Observes.Kind.resilient or Observes.Kind.safe (the default), depending on whether they should or should not execute after previous critical failures;
  • the delay during which events are accumulated before being delivered.
Author:
Fabio Simeoni, Luca Frosini (ISTI-CNR)
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    long
    The minimum duration in milliseconds between the delivery of two subsequent events.
    The kind of the observer Observes.Kind.safe by default.
    The event qualifiers.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default qualifier for events that should be observed by all observers regardless of specific qualifiers.
  • Field Details

    • Any

      static final String Any
      Default qualifier for events that should be observed by all observers regardless of specific qualifiers.
      See Also:
  • Element Details

    • value

      String[] value
      The event qualifiers.
      Returns:
      the qualifiers, Any by default.
      Default:
      {"any"}
    • kind

      The kind of the observer Observes.Kind.safe by default.
      Returns:
      the kind
      Default:
      safe
    • every

      long every
      The minimum duration in milliseconds between the delivery of two subsequent events.
      Returns:
      the kind
      Default:
      0L