@Override
            public boolean open(final RetryContext context, final RetryCallback __) {
                context.setAttribute("retry.maxAttempts", retryPolicy.getMaxAttempts());
                return RetryListener.super.open(context, __);
            }
Do and retry with a max number of attempts.

@param <T>             the type parameter
@param clazzes         the clazzes
@param callback        the callback
@param maximumAttempts the maximum attempts
@return the t
@throws Exception the exception
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/function/FunctionUtils.java