public class ObserverMethodImpl<T,X> extends Object implements 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.
| Modifier and Type | Field and Description |
|---|---|
protected BeanManagerImpl |
beanManager |
protected RIBean<X> |
declaringBean |
static String |
ID_PREFIX |
static String |
ID_SEPARATOR |
protected MethodInjectionPoint<T,? super X> |
observerMethod |
protected TransactionPhase |
transactionPhase |
| Modifier | Constructor and Description |
|---|---|
protected |
ObserverMethodImpl(WeldMethod<T,? super X> observer,
RIBean<X> declaringBean,
BeanManagerImpl manager)
Creates an Observer which describes and encapsulates an observer method
(8.5).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Class<X> |
getBeanClass()
Obtains the bean class of the bean that declares the
observer method.
|
Annotation[] |
getBindingsAsArray() |
RIBean<X> |
getDeclaringBean() |
String |
getId() |
Set<WeldInjectionPoint<?,?>> |
getInjectionPoints() |
MethodInjectionPoint<T,? super X> |
getMethod() |
Set<WeldInjectionPoint<?,?>> |
getNewInjectionPoints() |
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. |
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)
Calls the observer method, passing the given event object.
|
protected void |
sendEvent(T event)
Invokes the observer method immediately passing the event.
|
String |
toString() |
public static final String ID_PREFIX
public static final String ID_SEPARATOR
protected BeanManagerImpl beanManager
protected final MethodInjectionPoint<T,? super X> observerMethod
protected TransactionPhase transactionPhase
protected ObserverMethodImpl(WeldMethod<T,? super X> observer, RIBean<X> declaringBean, BeanManagerImpl manager)
observer - The observerdeclaringBean - The observer beanmanager - The Bean managerpublic Set<WeldInjectionPoint<?,?>> getInjectionPoints()
public Set<WeldInjectionPoint<?,?>> getNewInjectionPoints()
public Class<X> getBeanClass()
ObserverMethodgetBeanClass in interface ObserverMethod<T>public Annotation[] getBindingsAsArray()
public Reception getReception()
ObserverMethodReception for the observer method. This
indicates if the observer is conditional or not.getReception in interface ObserverMethod<T>Receptionpublic Set<Annotation> getObservedQualifiers()
ObserverMethodgetObservedQualifiers in interface ObserverMethod<T>public Type getObservedType()
ObserverMethodgetObservedType in interface ObserverMethod<T>public TransactionPhase getTransactionPhase()
ObserverMethodTransactionPhase for the observer method.getTransactionPhase in interface ObserverMethod<T>TransactionPhasepublic MethodInjectionPoint<T,? super X> getMethod()
public void initialize()
public void notify(T event)
ObserverMethodnotify in interface ObserverMethod<T>event - the event objectprotected void sendEvent(T event)
event - The event to notify observer withprotected boolean ignore(T event)
public String getId()
Copyright © 2013 Seam Framework. All Rights Reserved.