javax.enterprise.inject.spi

## Interface ObserverMethod<T>

- Type Parameters:
    `T` - the event type

      public interface ObserverMethod<T>

  Represents an observer method of an enabled bean. Defines everything the container needs to know about an observer method.

  Author:
    Gavin King, David Allen

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Class<?>` | `getBeanClass()` Obtains the class of the type that declares the observer method.
    `Set<Annotation>` | `getObservedQualifiers()` Obtains the set of observed event qualifiers.
    `Type` | `getObservedType()` Obtains the observed event type.
    `Reception` | `getReception()` Obtains the specified `Reception` for the observer method.
    `TransactionPhase` | `getTransactionPhase()` Obtains the specified `TransactionPhase` for the observer method.
    `void` | `notify(T event)` Calls the observer method, passing the given event object.

- - ### Method Detail

    - #### getBeanClass

          Class<?> getBeanClass()

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

      Returns:
        the defining class

    - #### getObservedType

          Type getObservedType()

      Obtains the observed event type.
      Returns:
        the observed event type

    - #### getObservedQualifiers

          Set<Annotation> getObservedQualifiers()

      Obtains the set of observed event qualifiers.
      Returns:
        the observed event qualifiers

    - #### getReception

          Reception getReception()

      Obtains the specified `Reception` for the observer method. This indicates if the observer is conditional or not.
      Returns:
        the `Reception`

    - #### getTransactionPhase

          TransactionPhase getTransactionPhase()

      Obtains the specified `TransactionPhase` for the observer method.
      Returns:
        the `TransactionPhase`

    - #### notify

          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

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.