use of org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl in project core by weld.
the class ProbeExtension method addContainerLifecycleEvent.
private <T> void addContainerLifecycleEvent(T event, Object info, BeanManagerImpl beanManagerImpl) {
ResolvedObservers<?> resolvedObservers = null;
Type eventType = null;
if (event instanceof AbstractContainerEvent) {
AbstractContainerEvent containerEvent = (AbstractContainerEvent) event;
eventType = containerEvent.getEventType();
resolvedObservers = beanManagerImpl.getGlobalLenientObserverNotifier().resolveObserverMethods(eventType);
} else if (event instanceof ProcessAnnotatedTypeImpl) {
ProcessAnnotatedTypeImpl<?> processAnnotatedTypeEvent = (ProcessAnnotatedTypeImpl<?>) event;
eventType = ProcessAnnotatedType.class;
info = Formats.formatType(processAnnotatedTypeEvent.getOriginalAnnotatedType().getBaseType(), false);
resolvedObservers = beanManagerImpl.getGlobalLenientObserverNotifier().resolveObserverMethods(ProcessAnnotatedTypeEventResolvable.of(processAnnotatedTypeEvent, beanManagerImpl.getServices().get(RequiredAnnotationDiscovery.class)));
}
if (resolvedObservers != null && eventType != null) {
probe.addEvent(new EventInfo(eventType, Collections.emptySet(), info, null, Reflections.cast(resolvedObservers.getAllObservers()), true, System.currentTimeMillis(), false));
}
}
Aggregations