Package org.apache.shiro.authz.aop
Class AuthorizingMethodInterceptor
- java.lang.Object
-
- org.apache.shiro.aop.MethodInterceptorSupport
-
- org.apache.shiro.authz.aop.AuthorizingMethodInterceptor
-
- All Implemented Interfaces:
MethodInterceptor
- Direct Known Subclasses:
AnnotationsAuthorizingMethodInterceptor
public abstract class AuthorizingMethodInterceptor extends MethodInterceptorSupport
Basic abstract class to support intercepting methods that perform authorization (access control) checks.- Since:
- 0.9
-
-
Constructor Summary
Constructors Constructor Description AuthorizingMethodInterceptor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
assertAuthorized(MethodInvocation methodInvocation)
Asserts that the specified MethodInvocation is allowed to continue by performing any necessary authorization (access control) checks first.Object
invoke(MethodInvocation methodInvocation)
Invokes the specified method (methodInvocation.
if authorization is allowed by first callingproceed
()assertAuthorized
.-
Methods inherited from class org.apache.shiro.aop.MethodInterceptorSupport
getSubject
-
-
-
-
Method Detail
-
invoke
public Object invoke(MethodInvocation methodInvocation) throws Throwable
Invokes the specified method (methodInvocation.
if authorization is allowed by first callingproceed
()assertAuthorized
.- Parameters:
methodInvocation
- theMethodInvocation
to execute.- Returns:
- the result of the invocation
- Throws:
Throwable
- if the method invocation throws a Throwable or if an error occurs in pre/post/finally advice.
-
assertAuthorized
protected abstract void assertAuthorized(MethodInvocation methodInvocation) throws AuthorizationException
Asserts that the specified MethodInvocation is allowed to continue by performing any necessary authorization (access control) checks first.- Parameters:
methodInvocation
- theMethodInvocation
to invoke.- Throws:
AuthorizationException
- if themethodInvocation
should not be allowed to continue/execute.
-
-