Package org.jboss.weld.event
Class ExtensionObserverMethodImpl<T,X>
- java.lang.Object
-
- org.jboss.weld.event.ObserverMethodImpl<T,X>
-
- org.jboss.weld.event.ExtensionObserverMethodImpl<T,X>
-
- All Implemented Interfaces:
jakarta.enterprise.inject.spi.ObserverMethod<T>
,jakarta.enterprise.inject.spi.Prioritized
,ContainerLifecycleEventObserverMethod<T>
,EventMetadataAwareObserverMethod<T>
public class ExtensionObserverMethodImpl<T,X> extends ObserverMethodImpl<T,X> implements ContainerLifecycleEventObserverMethod<T>
An implementation ofObserverMethod
used for events delivered to extensions. The observer method does not require contexts to be active.- Author:
- Jozef Hartinger
-
-
Field Summary
-
Fields inherited from class org.jboss.weld.event.ObserverMethodImpl
beanManager, declaringBean, ID_PREFIX, ID_SEPARATOR, observerMethod, SPECIAL_PARAM_MARKERS, transactionPhase
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExtensionObserverMethodImpl(EnhancedAnnotatedMethod<T,? super X> observer, RIBean<X> declaringBean, BeanManagerImpl manager, boolean isAsync)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkRequiredTypeAnnotations(EnhancedAnnotatedParameter<?,?> eventParameter)
protected String
createTypeId(RIBean<?> declaringBean)
boolean
equals(Object obj)
protected Object
getReceiver(jakarta.enterprise.context.spi.CreationalContext<X> ctx)
Collection<Class<? extends Annotation>>
getRequiredAnnotations()
Collection<Class<? extends Annotation>>
getRequiredScopeAnnotations()
int
hashCode()
protected MethodInjectionPoint<T,? super X>
initMethodInjectionPoint(EnhancedAnnotatedMethod<T,? super X> observer, RIBean<X> declaringBean, BeanManagerImpl manager)
protected Set<Class<? extends Annotation>>
initRequiredTypeAnnotations(EnhancedAnnotatedMethod<T,? super X> observer)
protected void
postNotify(T event, Object receiver)
protected void
preNotify(T event, Object receiver)
Hooks allowing subclasses to perform additional logic just before and just after an event is delivered to an observer method.protected void
sendEvent(T event, Object receiver, jakarta.enterprise.context.spi.CreationalContext<?> creationalContext)
Note thatCreationalContext.release()
is not invoked within this method.-
Methods inherited from class org.jboss.weld.event.ObserverMethodImpl
createId, getBeanClass, getDeclaringBean, getEventParameter, getId, getInjectionPoints, getMethod, getObservedQualifiers, getObservedType, getPriority, getReception, getTransactionPhase, initialize, isAsync, isEventMetadataRequired, notify, sendEvent, toString
-
-
-
-
Constructor Detail
-
ExtensionObserverMethodImpl
protected ExtensionObserverMethodImpl(EnhancedAnnotatedMethod<T,? super X> observer, RIBean<X> declaringBean, BeanManagerImpl manager, boolean isAsync)
-
-
Method Detail
-
initRequiredTypeAnnotations
protected Set<Class<? extends Annotation>> initRequiredTypeAnnotations(EnhancedAnnotatedMethod<T,? super X> observer)
-
checkRequiredTypeAnnotations
protected void checkRequiredTypeAnnotations(EnhancedAnnotatedParameter<?,?> eventParameter)
- Overrides:
checkRequiredTypeAnnotations
in classObserverMethodImpl<T,X>
-
initMethodInjectionPoint
protected MethodInjectionPoint<T,? super X> initMethodInjectionPoint(EnhancedAnnotatedMethod<T,? super X> observer, RIBean<X> declaringBean, BeanManagerImpl manager)
- Overrides:
initMethodInjectionPoint
in classObserverMethodImpl<T,X>
-
preNotify
protected void preNotify(T event, Object receiver)
Description copied from class:ObserverMethodImpl
Hooks allowing subclasses to perform additional logic just before and just after an event is delivered to an observer method.- Overrides:
preNotify
in classObserverMethodImpl<T,X>
-
postNotify
protected void postNotify(T event, Object receiver)
- Overrides:
postNotify
in classObserverMethodImpl<T,X>
-
getReceiver
protected Object getReceiver(jakarta.enterprise.context.spi.CreationalContext<X> ctx)
- Overrides:
getReceiver
in classObserverMethodImpl<T,X>
-
sendEvent
protected void sendEvent(T event, Object receiver, jakarta.enterprise.context.spi.CreationalContext<?> creationalContext)
Description copied from class:ObserverMethodImpl
Note thatCreationalContext.release()
is not invoked within this method.- Overrides:
sendEvent
in classObserverMethodImpl<T,X>
-
createTypeId
protected String createTypeId(RIBean<?> declaringBean)
- Overrides:
createTypeId
in classObserverMethodImpl<T,X>
-
getRequiredAnnotations
public Collection<Class<? extends Annotation>> getRequiredAnnotations()
- Specified by:
getRequiredAnnotations
in interfaceContainerLifecycleEventObserverMethod<T>
- Returns:
- a collection of required annotations used to filter ProcessAnnotatedType events
- See Also:
WithAnnotations
-
getRequiredScopeAnnotations
public Collection<Class<? extends Annotation>> getRequiredScopeAnnotations()
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classObserverMethodImpl<T,X>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObserverMethodImpl<T,X>
-
-