Spring-Security (学习记录七)--实现FilterInvocationSecurityMetadataSource的类将无法切入声明式事物
2016-08-29 10:44
471 查看
实现了FilterInvocationSecurityMetadataSource 的类将无法切入声明式事物。
原因:
[Toc]
1 查看继承关系
先查看FilterInvocationSecurityMetadataSource的继承结构,可以看出,这个类是AopInfrastructureBean的子接口2 说明
可以看出FilterInvocationSecurityMetadataSource 是SecurityMetadataSource的子类,这个SecurityMetadataSource类的源码中可以看出是继承AopInfrastructureBean接口的,在spring中 AopInfrastructureBean接口为一个标记接口,该接口有以下描述:Marker interface that indicates a bean that is part of Spring's AOP infrastructure. In particular, this implies that any such bean is not subject to auto-proxying, even if a pointcut would match. 这里说明了该接口 不支持自动代理,即时他是一个匹配的接入点,也无法切入事物。
3 查看源码:
/** * Marker interface for <code>SecurityMetadataSource</code> implementations * that are designed to perform lookups keyed on {@link FilterInvocation}s. * * @author Ben Alex */ public interface FilterInvocationSecurityMetadataSource extends SecurityMetadataSource {}
/** * Implemented by classes that store and can identify the {@link ConfigAttribute}s that applies to a given secure object * invocation. * * @author Ben Alex */ public interface SecurityMetadataSource extends AopInfrastructureBean { }
/** * Marker interface that indicates a bean that is part of Spring's * AOP infrastructure. In particular, this implies that any such bean * is not subject to auto-proxying, even if a pointcut would match. * * @author Juergen Hoeller * @since 2.0.3 * @see org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator * @see org.springframework.aop.scope.ScopedProxyFactoryBean */ public interface AopInfrastructureBean { }
相关文章推荐
- Spring学习总结(13)——Spring+Log4j+ActiveMQ实现远程记录日志
- Spring-Security (学习记录三)--读取数据库中的用户和角色
- Spring学习总结(13)——Spring+Log4j+ActiveMQ实现远程记录日志
- SSH学习——声明式事物管理(Spring)
- Spring学习---(5)注解方式实现Spring声明式事务管理
- Spring事物分析(2):声明式事物实现的原理
- spring4学习记录05-spring mvc实战之框架构建测试jpa借助spring-data实现自动化jpa
- Spring-Security (学习记录五)--配置登录时,密码采用md5加密,以及获取登录信息属性监听同步自己想要的登录信息
- spring整合hibernate实现声明式事物---个人笔记
- JavaWeb学习记录总结(二十九)--Servlet\Session\Cookie\Filter实现自动登录和记住密码
- Spring-Security (学习记录二)--修改为自己的登录页面
- Spring-Security (学习记录一)--登录
- 记录学习的点滴(Spring+Mybatis+Atomikos+Tomcat实现分布式事务管理)
- spring2.x使用aop实现声明式日志记录
- Spring学习---(4)XML方式实现Spring声明式事务管理
- Spring-Security (学习记录六)--采用ehcache缓存UserDetails
- Spring-Security (学习记录四)--配置权限过滤器,采用数据库方式获取权限
- MyBatis学习笔记-Spring集成DAO层实现方式记录
- cxf+spring实现ws-security的数字证书验证方式的记录(包括生成证书步骤)
- SSH学习——声明式事物管理(Spring)