Class AspectJMethodSecurityInterceptor

  • All Implemented Interfaces:
    org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.MessageSourceAware

    public final class AspectJMethodSecurityInterceptor
    extends MethodSecurityInterceptor
    AspectJ JoinPoint security interceptor which wraps the JoinPoint in a MethodInvocation adapter to make it compatible with security infrastructure classes which only support MethodInvocations.

    One of the invoke methods should be called from the around() advice in your aspect. Alternatively you can use one of the pre-defined aspects from the aspects module.

    Since:
    3.0.3
    • Constructor Detail

      • AspectJMethodSecurityInterceptor

        public AspectJMethodSecurityInterceptor()
    • Method Detail

      • invoke

        public java.lang.Object invoke​(org.aspectj.lang.JoinPoint jp)
                                throws java.lang.Throwable
        Method that is suitable for user with @Aspect notation.
        Parameters:
        jp - The AspectJ joint point being invoked which requires a security decision
        Returns:
        The returned value from the method invocation
        Throws:
        java.lang.Throwable - if the invocation throws one
      • invoke

        public java.lang.Object invoke​(org.aspectj.lang.JoinPoint jp,
                                       AspectJCallback advisorProceed)
        Method that is suitable for user with traditional AspectJ-code aspects.
        Parameters:
        jp - The AspectJ joint point being invoked which requires a security decision
        advisorProceed - the advice-defined anonymous class that implements AspectJCallback containing a simple return proceed(); statement
        Returns:
        The returned value from the method invocation