Search in sources :

Example 1 with ObserverNotifier

use of org.jboss.weld.event.ObserverNotifier 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

ArrayList (java.util.ArrayList)1 ObserverMethod (javax.enterprise.inject.spi.ObserverMethod)1 ObserverNotifier (org.jboss.weld.event.ObserverNotifier)1