org.apache.webbeans.event
Class NotificationManager

java.lang.Object
  extended by org.apache.webbeans.event.NotificationManager

public final class NotificationManager
extends Object


Field Summary
static Set<Class> CONTAINER_EVENT_CLASSES
           
 
Constructor Summary
NotificationManager(WebBeansContext webBeansContext)
           
 
Method Summary
<T> void
addObserver(javax.enterprise.inject.spi.ObserverMethod<T> observer, Type eventType)
           
<T> void
addObserver(javax.enterprise.inject.spi.ObserverMethod<T> observer, javax.enterprise.util.TypeLiteral<T> typeLiteral)
           
 void clearCaches()
          This methods needs to get called after the container got started.
 void fireEvent(Object event, EventMetadataImpl metadata, boolean isLifecycleEvent)
           
<T> javax.enterprise.inject.spi.ObserverMethod<?>
getObservableMethodForAnnotatedMethod(javax.enterprise.inject.spi.AnnotatedMethod<?> annotatedMethod, javax.enterprise.inject.spi.AnnotatedParameter<?> annotatedParameter, AbstractOwbBean<T> bean)
          Gets observer method from given annotated method.
 List<javax.enterprise.inject.spi.ObserverMethod<?>> getObserverMethods()
           
 boolean hasContextLifecycleObserver(Annotation lifecycleEvent)
           
 boolean isContainerEvent(javax.enterprise.inject.spi.AnnotatedParameter<?> annotatedParameter)
           
<T> Set<javax.enterprise.inject.spi.ObserverMethod<? super T>>
resolveObservers(T event, EventMetadataImpl metadata, boolean isLifecycleEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTAINER_EVENT_CLASSES

public static final Set<Class> CONTAINER_EVENT_CLASSES
Constructor Detail

NotificationManager

public NotificationManager(WebBeansContext webBeansContext)
Method Detail

clearCaches

public void clearCaches()
This methods needs to get called after the container got started. This is to avoid that events which already got fired during bootstrap in Extensions will get cached and events from beans thus get ignored.


hasContextLifecycleObserver

public boolean hasContextLifecycleObserver(Annotation lifecycleEvent)
Parameters:
lifecycleEvent - e.g. DestroyedLiteral.INSTANCE_REQUEST_SCOPED
Returns:
whether the given Initialized or Destroyed event has observer methods.

getObserverMethods

public List<javax.enterprise.inject.spi.ObserverMethod<?>> getObserverMethods()

addObserver

public <T> void addObserver(javax.enterprise.inject.spi.ObserverMethod<T> observer,
                            Type eventType)

addObserver

public <T> void addObserver(javax.enterprise.inject.spi.ObserverMethod<T> observer,
                            javax.enterprise.util.TypeLiteral<T> typeLiteral)

resolveObservers

public <T> Set<javax.enterprise.inject.spi.ObserverMethod<? super T>> resolveObservers(T event,
                                                                                       EventMetadataImpl metadata,
                                                                                       boolean isLifecycleEvent)

fireEvent

public void fireEvent(Object event,
                      EventMetadataImpl metadata,
                      boolean isLifecycleEvent)

getObservableMethodForAnnotatedMethod

public <T> javax.enterprise.inject.spi.ObserverMethod<?> getObservableMethodForAnnotatedMethod(javax.enterprise.inject.spi.AnnotatedMethod<?> annotatedMethod,
                                                                                               javax.enterprise.inject.spi.AnnotatedParameter<?> annotatedParameter,
                                                                                               AbstractOwbBean<T> bean)
Gets observer method from given annotated method.

Type Parameters:
T - bean type info
Parameters:
annotatedMethod - annotated method for observer
bean - bean instance
Returns:
ObserverMethod

isContainerEvent

public boolean isContainerEvent(javax.enterprise.inject.spi.AnnotatedParameter<?> annotatedParameter)


Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.