| | |
| | | .split("/"); |
| | | for (int i = 0; i < params.length; i++) { |
| | | ad.routeParams.put(params[i], i); |
| | | Logger.getLogger(Handler.class.getName()).log(Level.FINER, "ActionDescriptor param {0} no. {1}", new Object[]{params[i], i}); |
| | | } |
| | | ad.route = route.substring(0, pos - 1); |
| | | } else { |
| | |
| | | // .log(Level.INFO, "{0} {1} {2}", new Object[]{methodType, route, className}); |
| | | //dispatcher.get(methodType).put(ad.route, ad); |
| | | Object adMapObj = dispatcher.get(methodType); |
| | | if(adMapObj instanceof HashMap hashMap) { |
| | | if(adMapObj instanceof HashMap) { |
| | | @SuppressWarnings("unchecked") |
| | | HashMap<String, ActionDescriptor> map = hashMap; |
| | | HashMap<String, ActionDescriptor> map = (HashMap) adMapObj; |
| | | map.put(ad.route, ad); |
| | | Logger.getLogger(Handler.class.getName()).log(Level.FINER, "ActionDescriptor route {0} className {1}", new Object[]{route, className}); |
| | | } else { |
| | |
| | | Logger.getLogger(Handler.class.getName()).log(Level.FINER, "Handle Request route {0} subroute {1}", new Object[]{route, subroute}); |
| | | ActionDescriptor ad = (ActionDescriptor) o; |
| | | String actorClassName = ad.className; |
| | | Logger.getLogger(Handler.class.getName()).log(Level.FINER, "Handle Request actor class name {0}", new Object[]{actorClassName}); |
| | | try { |
| | | Class actorClass = Class.forName(actorClassName); |
| | | Logger.getLogger(Handler.class.getName()).log(Level.FINER, "Handle Request actor class found: {0}", new Object[]{actorClass.getName()}); |
| | | Method[] methods = actorClass.getMethods(); |
| | | for (Method method : methods) { |
| | | Action action = method.getAnnotation(Action.class); |
| | |
| | | actionArgs[k] = queryParams.get(methodParam.getName()); |
| | | } else { |
| | | actionArgs[k] = routeParams[i + 1]; |
| | | } |
| | | Logger.getLogger(Handler.class.getName()).finer("routeParam " + i+1 + ": " + routeParams[i + 1]); |
| | | } |
| | | Logger.getLogger(Handler.class.getName()).finer("ActionArgs " + k + ": " + actionArgs[k]); |
| | | } |
| | | ++k; |
| | | } |