Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Ask spring to find (and load if not loaded?) all beans annotated with @JrpcController
- Map<String,Object> beans = context.getBeansWithAnnotation(JrpcController.class);
- // https://stackoverflow.com/questions/27929965/find-method-level-custom-annotation-in-a-spring-context
- for (Map.Entry<String, Object> entry : beans.entrySet()) {
- Object bean = entry.getValue();
- Class<?> beanClass = bean.getClass();
- JrpcController jrpcController = beanClass.getAnnotation(JrpcController.class);
- // bean is an AOP proxy
- if (jrpcController == null) {
- beanClass = AopProxyUtils.ultimateTargetClass(bean);
- jrpcController = beanClass.getAnnotation(JrpcController.class);
- }
- // Ищем в бине метод, помеченный аннотацией @JrpcMethod
- for (Method method : beanClass.getDeclaredMethods()) {
Add Comment
Please, Sign In to add comment