org.tynamo.shiro.extension.authz.aop
Class AopHelper

java.lang.Object
  extended by org.tynamo.shiro.extension.authz.aop.AopHelper

public class AopHelper
extends java.lang.Object

Simple util class, help work with annotations and create interceptors based on annotations.


Constructor Summary
AopHelper()
           
 
Method Summary
static org.apache.shiro.authz.aop.AuthorizingAnnotationHandler createHandler(java.lang.annotation.Annotation annotation)
          Create AuthorizingAnnotationHandler for annotation.
static java.util.List<SecurityInterceptor> createSecurityInterceptors(java.lang.reflect.Method method, java.lang.Class<?> clazz)
          Create list of SecurityInterceptor instances for method.
static java.util.List<SecurityInterceptor> createSecurityInterceptorsSeeingInterfaces(java.lang.reflect.Method method, java.lang.Class<?> targetClass)
          Create list of SecurityInterceptor instances for method.
static java.lang.reflect.Method findTargetMethod(java.lang.reflect.Method method, java.lang.Class<?> targetClass)
          Find the target method of interface.
static java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> getAutorizationAnnotationClasses()
           
static boolean isInterceptOnClassAnnotation(int modifiers)
          Rule under which determined the fate of the class contains annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AopHelper

public AopHelper()
Method Detail

createHandler

public static org.apache.shiro.authz.aop.AuthorizingAnnotationHandler createHandler(java.lang.annotation.Annotation annotation)
Create AuthorizingAnnotationHandler for annotation.

Parameters:
annotation -
Returns:

createSecurityInterceptors

public static java.util.List<SecurityInterceptor> createSecurityInterceptors(java.lang.reflect.Method method,
                                                                             java.lang.Class<?> clazz)
Create list of SecurityInterceptor instances for method. This method search all method and class annotations and use annotation data for create interceptors.

This method considers only those annotations that have been declared in the set through parameters of the method and class, regardless of the inheritance or interface implementations

Parameters:
method -
clazz -
Returns:

createSecurityInterceptorsSeeingInterfaces

public static java.util.List<SecurityInterceptor> createSecurityInterceptorsSeeingInterfaces(java.lang.reflect.Method method,
                                                                                             java.lang.Class<?> targetClass)
Create list of SecurityInterceptor instances for method. This method search all method and class annotations and use annotation data for create interceptors.

In contrast of the createSecurityInterceptors(Method, Class), this method looking for the annotations in all interfaces, witch implement the targetClass.

The following rules


findTargetMethod

public static java.lang.reflect.Method findTargetMethod(java.lang.reflect.Method method,
                                                        java.lang.Class<?> targetClass)
Find the target method of interface.

Ensure this: If a class have an interface, then method parameter from interface and targetClass implementation.


isInterceptOnClassAnnotation

public static boolean isInterceptOnClassAnnotation(int modifiers)
Rule under which determined the fate of the class contains annotation.

All public and protected methods.


getAutorizationAnnotationClasses

public static java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> getAutorizationAnnotationClasses()


Copyright © 2004-2012. All Rights Reserved.