|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.webbeans.event.ObserverMethodImpl<T>
T - event typepublic class ObserverMethodImpl<T>
Defines observers that are declared in observer methods.
Example:
public class X {
public void afterLoggedIn(@Observes @Current LoggedInEvent event)
{
.....
}
}
Above class X instance observes for the event with type LoggedInEvent
and event qualifier is Current. Whenever event is fired, its javax.enterprise.inject.spi.ObserverMethod#notify()
method is called.
| Constructor Summary | |
|---|---|
ObserverMethodImpl(AbstractOwbBean<?> bean,
javax.enterprise.inject.spi.AnnotatedMethod<T> annotatedObserverMethod,
javax.enterprise.inject.spi.AnnotatedParameter<T> annotatedObservesParameter)
used if the qualifiers and event type are already known, e.g. from the XML. |
|
| Method Summary | |
|---|---|
protected void |
checkObserverCondition(javax.enterprise.inject.spi.AnnotatedParameter<T> annotatedObservesParameter)
|
Class<?> |
getBeanClass()
Returns observer owner bean. |
Set<javax.enterprise.inject.spi.InjectionPoint> |
getInjectionPoints()
Returns the InjectionPoints for the parameters of this observer method. |
protected List<org.apache.webbeans.event.ObserverMethodImpl.ObserverParams> |
getMethodArguments(Object event,
javax.enterprise.inject.spi.EventMetadata metadata)
Gets observer method parameters. |
Set<Annotation> |
getObservedQualifiers()
|
Type |
getObservedType()
|
javax.enterprise.inject.spi.AnnotatedMethod<T> |
getObserverMethod()
|
javax.enterprise.event.Reception |
getReception()
|
javax.enterprise.event.TransactionPhase |
getTransactionPhase()
|
protected WebBeansContext |
getWebBeansContext()
|
protected void |
invoke(Object object,
Object[] args)
|
void |
notify(T event)
|
void |
notify(T event,
javax.enterprise.inject.spi.EventMetadata metadata)
will actually call the underlying observer method with the specified event metadata |
void |
setObserverMethod(javax.enterprise.inject.spi.AnnotatedMethod<T> m)
Provides a way to set the observer method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObserverMethodImpl(AbstractOwbBean<?> bean,
javax.enterprise.inject.spi.AnnotatedMethod<T> annotatedObserverMethod,
javax.enterprise.inject.spi.AnnotatedParameter<T> annotatedObservesParameter)
bean - annotatedObserverMethod - | Method Detail |
|---|
protected void checkObserverCondition(javax.enterprise.inject.spi.AnnotatedParameter<T> annotatedObservesParameter)
public Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
InjectionPoints for the parameters of this observer method.
getInjectionPoints in interface OwbObserverMethod<T>public void notify(T event)
notify in interface javax.enterprise.inject.spi.ObserverMethod<T>
public void notify(T event,
javax.enterprise.inject.spi.EventMetadata metadata)
notify in interface OwbObserverMethod<T>
protected void invoke(Object object,
Object[] args)
throws IllegalAccessException,
InvocationTargetException
IllegalAccessException
InvocationTargetException
protected List<org.apache.webbeans.event.ObserverMethodImpl.ObserverParams> getMethodArguments(Object event,
javax.enterprise.inject.spi.EventMetadata metadata)
event - event payload
public Class<?> getBeanClass()
getBeanClass in interface javax.enterprise.inject.spi.ObserverMethod<T>public Set<Annotation> getObservedQualifiers()
getObservedQualifiers in interface javax.enterprise.inject.spi.ObserverMethod<T>public Type getObservedType()
getObservedType in interface javax.enterprise.inject.spi.ObserverMethod<T>public javax.enterprise.event.Reception getReception()
getReception in interface javax.enterprise.inject.spi.ObserverMethod<T>public javax.enterprise.event.TransactionPhase getTransactionPhase()
getTransactionPhase in interface javax.enterprise.inject.spi.ObserverMethod<T>public javax.enterprise.inject.spi.AnnotatedMethod<T> getObserverMethod()
protected WebBeansContext getWebBeansContext()
public void setObserverMethod(javax.enterprise.inject.spi.AnnotatedMethod<T> m)
m - method to be invoked as the observer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||