* Lets detect all producer methods creating instances of {@link RouteBuilder} which are annotated with {@link org
* .apache.camel.cdi.ContextName}
* so they can be auto-registered
*/
public void detectProducerRoutes(@Observes ProcessProducerMethod<?, ?> event) {
Annotated annotated = event.getAnnotated();
ContextName annotation = annotated.getAnnotation(ContextName.class);
Class<?> returnType = event.getAnnotatedProducerMethod().getJavaMember().getReturnType();
if (isRoutesBean(returnType)) {
addRouteBuilderBean(event.getBean(), annotation);
}
}