* Introspects the methods for any @Produces
*/
private void introspectObservers(AnnotatedType<X> beanType,
AnnotatedType<X> extAnnType)
{
EventManager eventManager = _context.getModuleInjectManager().getEventManager();
// ioc/0b26
for (AnnotatedMethod<? super X> beanMethod : beanType.getMethods()) {
/*
if (! beanMethod.getJavaMember().getDeclaringClass().equals(beanType.getJavaClass())
&& ! beanType.isAnnotationPresent(Specializes.class)) {
continue;
}
*/
AnnotatedMethod<? super X> apiMethod
= AnnotatedTypeUtil.findMethod(extAnnType, beanMethod);
boolean isBeanMethod = false;
if (apiMethod == null) {
apiMethod = beanMethod;
isBeanMethod = true;
}
else if (apiMethod instanceof AnnotatedMethodImpl<?>) {
// ioc/0b0h
AnnotatedMethodImpl<? super X> apiMethodImpl
= (AnnotatedMethodImpl<? super X>) apiMethod;
apiMethodImpl.addAnnotations(beanMethod.getAnnotations());
for (int i = 0; i < apiMethod.getParameters().size(); i++) {
AnnotatedParameterImpl<?> paramImpl
= (AnnotatedParameterImpl<?>) apiMethod.getParameters().get(i);
AnnotatedParameter<?> beanParam = beanMethod.getParameters().get(i);
paramImpl.addAnnotations(beanParam.getAnnotations());
}
}
int param = EventManager.findObserverAnnotation(apiMethod);
if (param >= 0) {
// ioc/0b0i - TCK
if (! isBeanMethod) {
}
else if (apiMethod.isStatic()) {
}
else if (_types.contains(beanType.getJavaClass())) {
// ioc/0b26
}
else {
throw new ConfigException(L.l("{0}.{1} is an invalid @Observes method because @Observes must be in the @Local API.",
beanMethod.getDeclaringType().getJavaClass().getSimpleName(),
beanMethod.getJavaMember().getName()));
}
eventManager.addObserver(this, apiMethod);
}
}
}