T - event typepublic class ObserverMethodImpl<T> extends Object implements OwbObserverMethod<T>
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.
| Modifier | Constructor and Description |
|---|---|
|
ObserverMethodImpl(AbstractOwbBean<?> ownerBean,
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.
|
protected |
ObserverMethodImpl(AbstractOwbBean<?> ownerBean,
javax.enterprise.inject.spi.AnnotatedMethod<T> annotatedObserverMethod,
javax.enterprise.inject.spi.AnnotatedParameter<T> annotatedObservesParameter,
boolean fireEvent) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
public ObserverMethodImpl(AbstractOwbBean<?> ownerBean, javax.enterprise.inject.spi.AnnotatedMethod<T> annotatedObserverMethod, javax.enterprise.inject.spi.AnnotatedParameter<T> annotatedObservesParameter)
ownerBean - annotatedObserverMethod - protected ObserverMethodImpl(AbstractOwbBean<?> ownerBean, javax.enterprise.inject.spi.AnnotatedMethod<T> annotatedObserverMethod, javax.enterprise.inject.spi.AnnotatedParameter<T> annotatedObservesParameter, boolean fireEvent)
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
protected List<org.apache.webbeans.event.ObserverMethodImpl.ObserverParams> getMethodArguments(Object event, javax.enterprise.inject.spi.EventMetadata metadata)
event - event payloadpublic 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 observerCopyright © 2008–2018 The Apache Software Foundation. All rights reserved.