public static AnnotationData getListenAnnotation(MethodAccess methodAccess) { AnnotationData listen = methodAccess.annotation("Listen"); if (listen == null) { listen = methodAccess.annotation("OnEvent"); } if (listen == null) { listen = methodAccess.annotation("Subscribe"); } if (listen == null) { listen = methodAccess.annotation("Consume"); } if (listen == null) { listen = methodAccess.annotation("Hear"); } return listen; }
private <T> Map<String, String> createMethodToChannelMap(final String channelPrefix, final Class<T> eventBusProxyInterface) { final Map<String, String> methodToChannelMap = new ConcurrentHashMap<>(20); final ClassMeta<T> classMeta = classMeta(eventBusProxyInterface); final AnnotationData classAnnotation = classMeta.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME); final String classEventBusName = AnnotationUtils.getClassEventChannelName(classMeta, classAnnotation); classMeta.methods().forEach(methodAccess -> { AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME); String methodEventBusName = methodAnnotation != null && methodAnnotation.getValues().get("value") != null ? methodAnnotation.getValues().get("value").toString() : null; if (Str.isEmpty(methodEventBusName)) { methodEventBusName = methodAccess.name(); } final String channelName = createChannelName(channelPrefix, classEventBusName, methodEventBusName); methodToChannelMap.put(methodAccess.method().toString(), channelName); }); return methodToChannelMap; }
private void processAnnotationForMethod(final MethodAccess methodAccess) { final AnnotationData annotation = methodAccess.annotation(QUEUE_CALLBACK_ANNOTATION_NAME); final Object[] values = (Object[]) annotation.getValues().get("value");
private void extractPathsFromRequestMetaList(final String servicePath, final Map<String, PathBuilder> pathBuilderMap, final List<ServiceMethodMeta> methodMetas) { for (ServiceMethodMeta methodMeta : methodMetas) { final List<RequestMeta> requestEndpoints = methodMeta.getRequestEndpoints(); final MethodAccess methodAccess = methodMeta.getMethodAccess(); if (methodAccess.method().isSynthetic()) { continue; } if (methodAccess.annotation("HideMethod") != null) { continue; } for (RequestMeta requestMeta : requestEndpoints) { final String requestURI = (servicePath + requestMeta.getRequestURI()).replaceAll("//", "/"); final PathBuilder pathBuilder = createPathBuilderIfAbsent(pathBuilderMap, requestURI); final List<RequestMethod> requestMethods = requestMeta.getRequestMethods(); for (RequestMethod requestMethod : requestMethods) { /* If one fails, we want to continue processing. */ try { extractPathFromRequestMeta(methodMeta, methodAccess, requestMeta, pathBuilder, requestMethod); } catch (Exception ex) { logger.warn("Problem processing path {} {}", requestURI, methodAccess.name()); logger.debug("Problem processing path", ex); } } } } }
AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME);
final AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME);
public static AnnotationData getListenAnnotation(MethodAccess methodAccess) { AnnotationData listen = methodAccess.annotation("Listen"); if (listen == null) { listen = methodAccess.annotation("OnEvent"); } if (listen == null) { listen = methodAccess.annotation("Subscribe"); } if (listen == null) { listen = methodAccess.annotation("Consume"); } if (listen == null) { listen = methodAccess.annotation("Hear"); } return listen; }
public static AnnotationData getListenAnnotation(MethodAccess methodAccess) { AnnotationData listen = methodAccess.annotation("Listen"); if (listen == null) { listen = methodAccess.annotation("OnEvent"); } if (listen == null) { listen = methodAccess.annotation("Subscribe"); } if (listen == null) { listen = methodAccess.annotation("Consume"); } if (listen == null) { listen = methodAccess.annotation("Hear"); } return listen; }
private <T> Map<String, String> createMethodToChannelMap(final String channelPrefix, final Class<T> eventBusProxyInterface) { final Map<String, String> methodToChannelMap = new ConcurrentHashMap<>(20); final ClassMeta<T> classMeta = classMeta(eventBusProxyInterface); final AnnotationData classAnnotation = classMeta.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME); final String classEventBusName = AnnotationUtils.getClassEventChannelName(classMeta, classAnnotation); classMeta.methods().forEach(methodAccess -> { AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME); String methodEventBusName = methodAnnotation != null && methodAnnotation.getValues().get("value") != null ? methodAnnotation.getValues().get("value").toString() : null; if (Str.isEmpty(methodEventBusName)) { methodEventBusName = methodAccess.name(); } final String channelName = createChannelName(channelPrefix, classEventBusName, methodEventBusName); methodToChannelMap.put(methodAccess.method().toString(), channelName); }); return methodToChannelMap; }
private <T> Map<String, String> createMethodToChannelMap(final String channelPrefix, final Class<T> eventBusProxyInterface) { final Map<String, String> methodToChannelMap = new ConcurrentHashMap<>(20); final ClassMeta<T> classMeta = classMeta(eventBusProxyInterface); final AnnotationData classAnnotation = classMeta.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME); final String classEventBusName = AnnotationUtils.getClassEventChannelName(classMeta, classAnnotation); classMeta.methods().forEach(methodAccess -> { AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME); String methodEventBusName = methodAnnotation != null && methodAnnotation.getValues().get("value") != null ? methodAnnotation.getValues().get("value").toString() : null; if (Str.isEmpty(methodEventBusName)) { methodEventBusName = methodAccess.name(); } final String channelName = createChannelName(channelPrefix, classEventBusName, methodEventBusName); methodToChannelMap.put(methodAccess.method().toString(), channelName); }); return methodToChannelMap; }
private void processAnnotationForMethod(final MethodAccess methodAccess) { final AnnotationData annotation = methodAccess.annotation(QUEUE_CALLBACK_ANNOTATION_NAME); final Object[] values = (Object[]) annotation.getValues().get("value");
private void processAnnotationForMethod(final MethodAccess methodAccess) { final AnnotationData annotation = methodAccess.annotation(QUEUE_CALLBACK_ANNOTATION_NAME); final Object[] values = (Object[]) annotation.getValues().get("value");
final AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME);
AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME);
final AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME);
AnnotationData methodAnnotation = methodAccess.annotation(AnnotationUtils.EVENT_CHANNEL_ANNOTATION_NAME);