|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shiro.aop.MethodInterceptorSupport
org.apache.shiro.aop.AnnotationMethodInterceptor
public abstract class AnnotationMethodInterceptor
MethodInterceptor that inspects a specific annotation on the method invocation before continuing its execution.
The annotation is acquired from theMethodInvocation via a
AnnotationResolver instance that may be configured. Unless
overridden, the default AnnotationResolver is a
| Constructor Summary | |
|---|---|
AnnotationMethodInterceptor(AnnotationHandler handler)
Constructs an AnnotationMethodInterceptor with the
AnnotationHandler that will be used to process annotations of a
corresponding type. |
|
AnnotationMethodInterceptor(AnnotationHandler handler,
AnnotationResolver resolver)
Constructs an AnnotationMethodInterceptor with the
AnnotationHandler that will be used to process annotations of a
corresponding type, using the specified AnnotationResolver to acquire annotations
at runtime. |
|
| Method Summary | |
|---|---|
protected Annotation |
getAnnotation(MethodInvocation mi)
Returns the Annotation that this interceptor will process for the specified method invocation. |
AnnotationHandler |
getHandler()
Returns the AnnotationHandler used to perform authorization behavior based on
an annotation discovered at runtime. |
AnnotationResolver |
getResolver()
Returns the AnnotationResolver to use to acquire annotations from intercepted
methods at runtime. |
void |
setHandler(AnnotationHandler handler)
Sets the AnnotationHandler used to perform authorization behavior based on
an annotation discovered at runtime. |
void |
setResolver(AnnotationResolver resolver)
Returns the AnnotationResolver to use to acquire annotations from intercepted
methods at runtime. |
boolean |
supports(MethodInvocation mi)
Returns true if this interceptor supports, that is, should inspect, the specified
MethodInvocation, false otherwise. |
| Methods inherited from class org.apache.shiro.aop.MethodInterceptorSupport |
|---|
getSubject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.shiro.aop.MethodInterceptor |
|---|
invoke |
| Constructor Detail |
|---|
public AnnotationMethodInterceptor(AnnotationHandler handler)
AnnotationMethodInterceptor with the
AnnotationHandler that will be used to process annotations of a
corresponding type.
handler - the handler to delegate to for processing the annotation.
public AnnotationMethodInterceptor(AnnotationHandler handler,
AnnotationResolver resolver)
AnnotationMethodInterceptor with the
AnnotationHandler that will be used to process annotations of a
corresponding type, using the specified AnnotationResolver to acquire annotations
at runtime.
handler - the handler to use to process any discovered annotationresolver - the resolver to use to locate/acquire the annotation| Method Detail |
|---|
public AnnotationHandler getHandler()
AnnotationHandler used to perform authorization behavior based on
an annotation discovered at runtime.
AnnotationHandler used to perform authorization behavior based on
an annotation discovered at runtime.public void setHandler(AnnotationHandler handler)
AnnotationHandler used to perform authorization behavior based on
an annotation discovered at runtime.
handler - the AnnotationHandler used to perform authorization behavior based on
an annotation discovered at runtime.public AnnotationResolver getResolver()
AnnotationResolver to use to acquire annotations from intercepted
methods at runtime. The annotation is then used by the handler to
perform authorization logic.
AnnotationResolver to use to acquire annotations from intercepted
methods at runtime.public void setResolver(AnnotationResolver resolver)
AnnotationResolver to use to acquire annotations from intercepted
methods at runtime. The annotation is then used by the handler to
perform authorization logic.
resolver - the AnnotationResolver to use to acquire annotations from intercepted
methods at runtime.public boolean supports(MethodInvocation mi)
true if this interceptor supports, that is, should inspect, the specified
MethodInvocation, false otherwise.
The default implementation simply does the following:
return getAnnotation(mi) != null
mi - the MethodInvocation for the method being invoked.
true if this interceptor supports, that is, should inspect, the specified
MethodInvocation, false otherwise.protected Annotation getAnnotation(MethodInvocation mi)
resolver using the internal annotation handler's
annotationClass.
mi - the MethodInvocation wrapping the Method from which the Annotation will be acquired.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||