org.jboss.weld.event
Class ObserverMethodImpl<T,X>

java.lang.Object
  extended by org.jboss.weld.event.ObserverMethodImpl<T,X>
All Implemented Interfaces:
javax.enterprise.inject.spi.ObserverMethod<T>

public class ObserverMethodImpl<T,X>
extends Object
implements javax.enterprise.inject.spi.ObserverMethod<T>

Reference implementation for the ObserverMethod interface, which represents an observer method. Each observer method has an event type which is the class of the event object being observed, and event binding types that are annotations applied to the event parameter to narrow the event notifications delivered.

Author:
David Allen, Marko Luksa

Field Summary
protected  BeanManagerImpl beanManager
           
protected  RIBean<X> declaringBean
           
static String ID_PREFIX
           
static String ID_SEPARATOR
           
protected  MethodInjectionPoint<T,? super X> observerMethod
           
protected  javax.enterprise.event.TransactionPhase transactionPhase
           
 
Constructor Summary
protected ObserverMethodImpl(WeldMethod<T,? super X> observer, RIBean<X> declaringBean, BeanManagerImpl manager)
          Creates an Observer which describes and encapsulates an observer method (8.5).
 
Method Summary
 boolean equals(Object obj)
           
 Class<X> getBeanClass()
           
 Annotation[] getBindingsAsArray()
           
 RIBean<X> getDeclaringBean()
           
 String getId()
           
 Set<WeldInjectionPoint<?,?>> getInjectionPoints()
           
 MethodInjectionPoint<T,? super X> getMethod()
           
 Set<WeldInjectionPoint<?,?>> getNewInjectionPoints()
           
 Set<Annotation> getObservedQualifiers()
           
 Type getObservedType()
           
 javax.enterprise.event.Reception getReception()
           
 javax.enterprise.event.TransactionPhase getTransactionPhase()
           
 int hashCode()
           
protected  boolean ignore(T event)
           
 void initialize()
          Completes initialization of the observer and allows derived types to override behavior.
 void notify(T event)
           
protected  void sendEvent(T event)
          Invokes the observer method immediately passing the event.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_PREFIX

public static final String ID_PREFIX

ID_SEPARATOR

public static final String ID_SEPARATOR
See Also:
Constant Field Values

beanManager

protected BeanManagerImpl beanManager

declaringBean

protected final RIBean<X> declaringBean

observerMethod

protected final MethodInjectionPoint<T,? super X> observerMethod

transactionPhase

protected javax.enterprise.event.TransactionPhase transactionPhase
Constructor Detail

ObserverMethodImpl

protected ObserverMethodImpl(WeldMethod<T,? super X> observer,
                             RIBean<X> declaringBean,
                             BeanManagerImpl manager)
Creates an Observer which describes and encapsulates an observer method (8.5).

Parameters:
observer - The observer
declaringBean - The observer bean
manager - The Bean manager
Method Detail

getInjectionPoints

public Set<WeldInjectionPoint<?,?>> getInjectionPoints()

getNewInjectionPoints

public Set<WeldInjectionPoint<?,?>> getNewInjectionPoints()

getBeanClass

public Class<X> getBeanClass()
Specified by:
getBeanClass in interface javax.enterprise.inject.spi.ObserverMethod<T>

getDeclaringBean

public RIBean<X> getDeclaringBean()

getBindingsAsArray

public Annotation[] getBindingsAsArray()

getReception

public javax.enterprise.event.Reception getReception()
Specified by:
getReception in interface javax.enterprise.inject.spi.ObserverMethod<T>

getObservedQualifiers

public Set<Annotation> getObservedQualifiers()
Specified by:
getObservedQualifiers in interface javax.enterprise.inject.spi.ObserverMethod<T>

getObservedType

public Type getObservedType()
Specified by:
getObservedType in interface javax.enterprise.inject.spi.ObserverMethod<T>

getTransactionPhase

public javax.enterprise.event.TransactionPhase getTransactionPhase()
Specified by:
getTransactionPhase in interface javax.enterprise.inject.spi.ObserverMethod<T>

getMethod

public MethodInjectionPoint<T,? super X> getMethod()
Returns:
the observerMethod

initialize

public void initialize()
Completes initialization of the observer and allows derived types to override behavior.


notify

public void notify(T event)
Specified by:
notify in interface javax.enterprise.inject.spi.ObserverMethod<T>

sendEvent

protected void sendEvent(T event)
Invokes the observer method immediately passing the event.

Parameters:
event - The event to notify observer with

ignore

protected boolean ignore(T event)

toString

public String toString()
Overrides:
toString in class Object

getId

public String getId()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013 Seam Framework. All Rights Reserved.