List of usage examples for org.springframework.web.reactive.result.method InvocableHandlerMethod InvocableHandlerMethod
public InvocableHandlerMethod(Object bean, Method method)
From source file:org.springframework.web.reactive.result.method.annotation.ControllerMethodResolver.java
private InvocableHandlerMethod createAttributeMethod(Object bean, Method method) { InvocableHandlerMethod invocable = new InvocableHandlerMethod(bean, method); invocable.setArgumentResolvers(this.modelAttributeResolvers); return invocable; }
From source file:org.springframework.web.reactive.result.method.annotation.ControllerMethodResolver.java
/** * Find an {@code @ExceptionHandler} method in {@code @ControllerAdvice} * components or in the controller of the given {@code @RequestMapping} method. *//*www. ja v a 2 s. c o m*/ @Nullable public InvocableHandlerMethod getExceptionHandlerMethod(Throwable ex, HandlerMethod handlerMethod) { Class<?> handlerType = handlerMethod.getBeanType(); // Controller-local first... Object targetBean = handlerMethod.getBean(); Method targetMethod = this.exceptionHandlerCache .computeIfAbsent(handlerType, ExceptionHandlerMethodResolver::new).resolveMethodByThrowable(ex); if (targetMethod == null) { // Global exception handlers... for (ControllerAdviceBean advice : this.exceptionHandlerAdviceCache.keySet()) { if (advice.isApplicableToBeanType(handlerType)) { targetBean = advice.resolveBean(); targetMethod = this.exceptionHandlerAdviceCache.get(advice).resolveMethodByThrowable(ex); if (targetMethod != null) { break; } } } } if (targetMethod == null) { return null; } InvocableHandlerMethod invocable = new InvocableHandlerMethod(targetBean, targetMethod); invocable.setArgumentResolvers(this.exceptionHandlerResolvers); return invocable; }