Interface ObserverMethod<T>

    • Method Detail

      • getBeanClass

        Class<?> getBeanClass()

        Obtains the class of the type that declares the observer method.

        Returns:
        the defining class
      • getReception

        Reception getReception()
        Obtains the specified Reception for the observer method. This indicates if the observer is conditional or not.
        Returns:
        the Reception
      • getPriority

        default int getPriority()
        The priority that will be used by the container to determine the notification order in which event observer methods are invoked.
        Specified by:
        getPriority in interface Prioritized
        Returns:
        The priority that will be used by the container to determine the notification order in which event observer methods are invoked.
        Since:
        2.0
      • notify

        default void notify​(T event)

        Calls the observer method, passing the given event object.

        The implementation of this method for a custom observer method is responsible for deciding whether to call the method if the getReception() returns Reception.IF_EXISTS.

        Parameters:
        event - the event object
      • notify

        default void notify​(EventContext<T> eventContext)
        Calls the observer method, passing the given event context.

        The container should always call this method, but the default implementation delegates to notify(Object).

        The implementation of this method for a custom observer method is responsible for deciding whether to call the method if the getReception() returns Reception.IF_EXISTS.

        Parameters:
        eventContext - EventContext used to notify observers
      • isAsync

        default boolean isAsync()

        Determines if this observer method is asynchronous

        Returns:
        returns true if the method is an asynchronous observer method (i.e. defined with ObservesAsync), otherwise returns false