public class ObserverMethodImpl<T,X> extends java.lang.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 java.lang.String |
ID_PREFIX |
static java.lang.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(java.lang.Object obj) |
java.lang.Class<X> |
getBeanClass()
Obtains the bean class of the bean that declares the
observer method.
|
java.lang.annotation.Annotation[] |
getBindingsAsArray() |
RIBean<X> |
getDeclaringBean() |
java.lang.String |
getId() |
java.util.Set<WeldInjectionPoint<?,?>> |
getInjectionPoints() |
MethodInjectionPoint<T,? super X> |
getMethod() |
java.util.Set<WeldInjectionPoint<?,?>> |
getNewInjectionPoints() |
java.util.Set<java.lang.annotation.Annotation> |
getObservedQualifiers()
Obtains the set of observed event qualifiers.
|
java.lang.reflect.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.
|
java.lang.String |
toString() |
public static final java.lang.String ID_PREFIX
public static final java.lang.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 java.util.Set<WeldInjectionPoint<?,?>> getInjectionPoints()
public java.util.Set<WeldInjectionPoint<?,?>> getNewInjectionPoints()
public java.lang.Class<X> getBeanClass()
ObserverMethodgetBeanClass in interface ObserverMethod<T>public java.lang.annotation.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 java.util.Set<java.lang.annotation.Annotation> getObservedQualifiers()
ObserverMethodgetObservedQualifiers in interface ObserverMethod<T>public java.lang.reflect.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 java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getId()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2014 Seam Framework. All Rights Reserved.