routing = m.getAnnotation(Routing.class);
} else {
log.debug("Routing not found on method " + m.getJavaMember().getName());
}
RouteType routeType = (routing == null) ? RouteType.BOTH : routing.value();
Route route = new RouteImpl(routeType).id(routeId);
boolean isResourced = m.isAnnotationPresent(Resource.class);
if (isResourced) {
Resource r = m.getAnnotation(Resource.class);
log.debug("Loading resource " + r.mappedName());
route.addDestinationJndiName(r.mappedName());
}
/* in this case, each method has one non destination and multiple
* destinations. this can take the form of resources or qualified
* resources.
*/
try {
for (AnnotatedParameter<?> ap : m.getParameters()) {
if (ap.getBaseType() instanceof Class) {
Class<?> clazz = (Class<?>) ap.getBaseType();
if (Destination.class.isAssignableFrom(clazz)) {
log.debug("Found another type of qualifier.");
//route.addDestinationQualifiers(ap.getAnnotations());
route.addAnnotatedParameter(ap);
} else if (ap.isAnnotationPresent(Observes.class)) {
route.setType(ap.getBaseType());
route.getQualifiers().addAll(getQualifiersFrom(ap.getAnnotations()));
}
}
}
} catch (Exception e) {
log.warn("Exception mapping for method " + m.getJavaMember().getDeclaringClass() + "." + m.getJavaMember().getName() + ", ", e);