solon.proxy
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon.proxy</artifactId>
</dependency>
1、描述
基础扩展插件,提供为 Solon 提供类动态代理的能力(内置有 asm 实现)。并实现注解能力:
注解 | 说明 |
---|---|
@ProxyComponent | 动态代理能力的组件(取代旧的:@Dao、@Service、@Repository 三个语义注解) |
具有类动态代理能力的Bean,才能支持对Method拦截。进而支持@Tran
、@Cache
等Aop功能。
2、代码应用
@ProxyComponent
public class DemoService{
@Inject
UserMapper userMapper;
@Tran
public void test(User user){
userMapper.add(user);
}
}