Interface PolicyAspectProcessor

  • All Known Implementing Classes:
    DefaultPolicyAspectProcessor

    public interface PolicyAspectProcessor
    Responsible for processing AOP calls to Policy annotated methods and running those requests through a PolicyEvaluator before allowing the call to proceed. The around advice will throw different classes of exceptions based on policy violations discovered. This exceptions should generally be handled and converted to expected HTTP status responses. This is generally done through an ExceptionHandler annotated method in a ControllerAdvice annotated class.

    Further customizations of Policy configuration can be achieved via PolicyOverride beans configured in Spring application context. PolicyOverride can also be used to introduce policy configuration in the absence of Policy annotation. PolicyOverride can also be used to remove existing Policy annotated configuration altogether.

    Author:
    Jeff Fischer
    • Method Detail

      • validate

        Object validate​(org.aspectj.lang.ProceedingJoinPoint joinPoint,
                        Object aspect)
                 throws Throwable
        Validate the Policy annotated method call
        Parameters:
        joinPoint - metadata about the method call
        aspect - the instance of the Aspect annotate class driving this call
        Returns:
        the result of the call
        Throws:
        Throwable - any exception