Package org.jboss.weld.bootstrap.events
Class ProcessObserverMethodImpl<T,X>
- java.lang.Object
-
- org.jboss.weld.bootstrap.events.ContainerEvent
-
- org.jboss.weld.bootstrap.events.AbstractContainerEvent
-
- org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent
-
- org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl<T,X>
-
- All Implemented Interfaces:
ProcessObserverMethod<T,X>,NotificationListener
- Direct Known Subclasses:
ProcessSyntheticObserverMethodImpl
public class ProcessObserverMethodImpl<T,X> extends AbstractDefinitionContainerEvent implements ProcessObserverMethod<T,X>
Implementation of the event used to notify observers for each observer method that is added.- Author:
- David Allen, Martin Kouba
-
-
Field Summary
Fields Modifier and Type Field Description protected ObserverMethod<T>observerMethodprotected booleanvetoed
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ObserverMethodConfigurator<T>configureObserverMethod()Returns aObserverMethodConfiguratorinitialized with theObserverMethodprocessed by this event, to configure a new ObserverMethod that will replace the original one at the end of the observer invocation.protected static <T,X>
ObserverMethod<T>fire(ProcessObserverMethodImpl<T,X> event)static <T,X>
ObserverMethod<T>fire(BeanManagerImpl beanManager, AnnotatedMethod<X> beanMethod, ObserverMethod<T> observerMethod)AnnotatedMethod<X>getAnnotatedMethod()TheAnnotatedMethodrepresenting the observer method.ObserverMethod<T>getObserverMethod()TheObserverMethodobject that will be used by the container to invoke the observer when a matching event is fired.booleanisDirty()voidpostNotify(Extension extension)voidsetObserverMethod(ObserverMethod<T> observerMethod)Replaces theObserverMethod.voidveto()Forces the container to ignore the observer method.-
Methods inherited from class org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent
addDefinitionError, fire
-
Methods inherited from class org.jboss.weld.bootstrap.events.AbstractContainerEvent
getActualTypeArguments, getBeanManager, getErrors, getEventType, getRawType
-
Methods inherited from class org.jboss.weld.bootstrap.events.ContainerEvent
checkWithinObserverNotification, getReceiver, preNotify
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.enterprise.inject.spi.ProcessObserverMethod
addDefinitionError
-
-
-
-
Field Detail
-
observerMethod
protected ObserverMethod<T> observerMethod
-
vetoed
protected boolean vetoed
-
-
Method Detail
-
fire
public static <T,X> ObserverMethod<T> fire(BeanManagerImpl beanManager, AnnotatedMethod<X> beanMethod, ObserverMethod<T> observerMethod)
-
fire
protected static <T,X> ObserverMethod<T> fire(ProcessObserverMethodImpl<T,X> event)
-
getAnnotatedMethod
public AnnotatedMethod<X> getAnnotatedMethod()
Description copied from interface:ProcessObserverMethodTheAnnotatedMethodrepresenting the observer method.If invoked upon a
ProcessSyntheticObserverMethodevent, non-portable behavior results and the returned value should be ignored.- Specified by:
getAnnotatedMethodin interfaceProcessObserverMethod<T,X>- Returns:
- the
AnnotatedMethodrepresenting the observer method
-
getObserverMethod
public ObserverMethod<T> getObserverMethod()
Description copied from interface:ProcessObserverMethodTheObserverMethodobject that will be used by the container to invoke the observer when a matching event is fired.- Specified by:
getObserverMethodin interfaceProcessObserverMethod<T,X>- Returns:
- the
ObserverMethodobject that will be used by the container to call the observer method
-
setObserverMethod
public void setObserverMethod(ObserverMethod<T> observerMethod)
Description copied from interface:ProcessObserverMethodReplaces theObserverMethod.- Specified by:
setObserverMethodin interfaceProcessObserverMethod<T,X>- Parameters:
observerMethod- the newObserverMethodobject to use
-
configureObserverMethod
public ObserverMethodConfigurator<T> configureObserverMethod()
Description copied from interface:ProcessObserverMethodReturns aObserverMethodConfiguratorinitialized with theObserverMethodprocessed by this event, to configure a new ObserverMethod that will replace the original one at the end of the observer invocation. Each call returns the same ObserverMethodConfigurator- Specified by:
configureObserverMethodin interfaceProcessObserverMethod<T,X>- Returns:
- a non reusable
ObserverMethodConfiguratorto configure the replacing ObserverMethod
-
veto
public void veto()
Description copied from interface:ProcessObserverMethodForces the container to ignore the observer method.- Specified by:
vetoin interfaceProcessObserverMethod<T,X>
-
isDirty
public boolean isDirty()
-
postNotify
public void postNotify(Extension extension)
- Specified by:
postNotifyin interfaceNotificationListener- Overrides:
postNotifyin classContainerEvent
-
-