Example usage for org.apache.shiro.aop AnnotationMethodInterceptor getHandler

List of usage examples for org.apache.shiro.aop AnnotationMethodInterceptor getHandler

Introduction

In this page you can find the example usage for org.apache.shiro.aop AnnotationMethodInterceptor getHandler.

Prototype

public AnnotationHandler getHandler() 

Source Link

Document

Returns the AnnotationHandler used to perform authorization behavior based on an annotation discovered at runtime.

Usage

From source file:fathom.shiro.aop.AopModule.java

License:Apache License

protected final void bindShiroInterceptor(final AnnotationMethodInterceptor methodInterceptor) {
    bindInterceptor(Matchers.any(), new AbstractMatcher<Method>() {
        public boolean matches(Method method) {
            Class<? extends Annotation> annotation = methodInterceptor.getHandler().getAnnotationClass();
            return method.getAnnotation(annotation) != null
                    || method.getDeclaringClass().getAnnotation(annotation) != null;
        }/*from  www  .  j a v a2s.com*/
    }, new AopAllianceMethodInterceptorAdapter(methodInterceptor));
}

From source file:org.killbill.billing.util.glue.KillBillShiroAopModule.java

License:Apache License

protected final void bindShiroInterceptorWithHierarchy(final AnnotationMethodInterceptor methodInterceptor) {
    bindInterceptor(Matchers.any(), new AbstractMatcher<Method>() {
        public boolean matches(final Method method) {
            final Class<? extends Annotation> annotation = methodInterceptor.getHandler().getAnnotationClass();
            return resolver.getAnnotationFromMethod(method, annotation) != null;
        }//from  w  ww .j  a v a  2 s.  co  m
    }, new AopAllianceMethodInterceptorAdapter(methodInterceptor));
}