Spring-Security (学习记录七)--实现FilterInvocationSecurityMetadataSource的类将无法切入声明式事物...

实现了FilterInvocationSecurityMetadataSource 的类将无法切入声明式事物。
原因:

1 查看继承关系

先查看FilterInvocationSecurityMetadataSource的继承结构,可以看出,这个类是AopInfrastructureBean的子接口

893235-20160829104324558-2142262624.png

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 {
}  

转载于:https://www.cnblogs.com/linhp/p/5817083.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值