Search in sources :

Example 6 with ObserverMethod

use of javax.enterprise.inject.spi.ObserverMethod in project core by weld.

the class ProbeObserver method resolveObservers.

private List<ObserverMethod<?>> resolveObservers(EventMetadata metadata, boolean containerEvent) {
    List<ObserverMethod<?>> observers = new ArrayList<ObserverMethod<?>>();
    final ObserverNotifier notifier = (containerEvent) ? manager.getAccessibleLenientObserverNotifier() : manager.getGlobalLenientObserverNotifier();
    ResolvedObservers<?> resolvedObservers = notifier.resolveObserverMethods(metadata.getType(), metadata.getQualifiers());
    for (ObserverMethod<?> observer : resolvedObservers.getAllObservers()) {
        // do not show ProbeObserver
        if (getBeanClass() != observer.getBeanClass()) {
            observers.add(observer);
        }
    }
    return ImmutableList.copyOf(observers);
}
Also used : ArrayList(java.util.ArrayList) ObserverNotifier(org.jboss.weld.event.ObserverNotifier) ObserverMethod(javax.enterprise.inject.spi.ObserverMethod)

Aggregations

ObserverMethod (javax.enterprise.inject.spi.ObserverMethod)6 ArrayList (java.util.ArrayList)3 Bean (javax.enterprise.inject.spi.Bean)2 EventMetadata (javax.enterprise.inject.spi.EventMetadata)2 BeanManagerImpl (org.apache.webbeans.container.BeanManagerImpl)2 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 Annotation (java.lang.annotation.Annotation)1 Type (java.lang.reflect.Type)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Set (java.util.Set)1 WeakHashMap (java.util.WeakHashMap)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 CompletionException (java.util.concurrent.CompletionException)1 CompletionStage (java.util.concurrent.CompletionStage)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1