/** * Gets fallback method for command method. * * @param enclosingType the enclosing class * @param commandMethod the command method. in the essence it can be a fallback * method annotated with HystrixCommand annotation that has a fallback as well. * @param extended true if the given commandMethod was derived using additional parameter, otherwise - false * @return new instance of {@link FallbackMethod} or {@link FallbackMethod#ABSENT} if there is no suitable fallback method for the given command */ public FallbackMethod getFallbackMethod(Class<?> enclosingType, Method commandMethod, boolean extended) { if (commandMethod.isAnnotationPresent(HystrixCommand.class)) { return FALLBACK_METHOD_FINDER.find(enclosingType, commandMethod, extended); } return FallbackMethod.ABSENT; }
/** * Gets fallback method for command method. * * @param enclosingType the enclosing class * @param commandMethod the command method. in the essence it can be a fallback * method annotated with HystrixCommand annotation that has a fallback as well. * @param extended true if the given commandMethod was derived using additional parameter, otherwise - false * @return new instance of {@link FallbackMethod} or {@link FallbackMethod#ABSENT} if there is no suitable fallback method for the given command */ public FallbackMethod getFallbackMethod(Class<?> enclosingType, Method commandMethod, boolean extended) { if (commandMethod.isAnnotationPresent(HystrixCommand.class)) { return FALLBACK_METHOD_FINDER.find(enclosingType, commandMethod, extended); } return FallbackMethod.ABSENT; }
public FallbackMethod find(Class<?> enclosingType, Method commandMethod, boolean extended) { if (canHandle(enclosingType, commandMethod)) { return doFind(enclosingType, commandMethod, extended); } else if (next != null) { return next.find(enclosingType, commandMethod, extended); } else { return FallbackMethod.ABSENT; } }
public FallbackMethod find(Class<?> enclosingType, Method commandMethod, boolean extended) { if (canHandle(enclosingType, commandMethod)) { return doFind(enclosingType, commandMethod, extended); } else if (next != null) { return next.find(enclosingType, commandMethod, extended); } else { return FallbackMethod.ABSENT; } }