/** * Get the {@code timeout} configured via the {@link Timed @Timed} * annotation on the supplied {@code method}. * <p>Negative configured values will be converted to {@code 0}. * @return the configured timeout, or {@code 0} if the method is not * annotated with {@code @Timed} */ public static long getTimeout(Method method) { Timed timed = AnnotatedElementUtils.findMergedAnnotation(method, Timed.class); if (timed == null) { return 0; } return Math.max(0, timed.millis()); }
/** * Get the {@code timeout} configured via the {@link Timed @Timed} * annotation on the supplied {@code method}. * <p>Negative configured values will be converted to {@code 0}. * @return the configured timeout, or {@code 0} if the method is not * annotated with {@code @Timed} */ public static long getTimeout(Method method) { Timed timed = AnnotatedElementUtils.findMergedAnnotation(method, Timed.class); if (timed == null) { return 0; } return Math.max(0, timed.millis()); }
/** * Get the {@code timeout} configured via the {@link Timed @Timed} * annotation on the supplied {@code method}. * <p>Negative configured values will be converted to {@code 0}. * @return the configured timeout, or {@code 0} if the method is not * annotated with {@code @Timed} */ public static long getTimeout(Method method) { Timed timed = AnnotatedElementUtils.findMergedAnnotation(method, Timed.class); if (timed == null) { return 0; } return Math.max(0, timed.millis()); }