AspectJ:切入点中的参数

我正在使用AspectJ来建议所有具有所选类参数的公共方法.我尝试了以下方法
pointcut permissionCheckMethods(Session sess) : 
    (execution(public * *(..,Session)) && args(*,sess));

这对于具有至少2个参数的方法非常有用:

public void delete(Object item,Session currentSession);

但它不适用于以下方法

public List listAll(Session currentSession);

我怎样才能改变我的切入点来建议两种方法执行?换句话说:我希望“..”通配符代表“零个或多个参数”,但看起来它意味着“一个或多个”……

解决方法

哦,好吧……我用这个讨厌的伎俩解决了这个问题.还在等待有人出现“官方”切入点定义.
pointcut permissionCheckMethods(EhealthSession eheSess) : 
    (execution(public * *(..,EhealthSession)) && args(*,eheSess))
    && !within(it.___.security.PermissionsCheck);

pointcut permissionCheckMethods2(EhealthSession eheSess) : 
    (execution(public * *(EhealthSession)) && args(eheSess))
    && !within(it.___.security.PermissionsCheck)
    && !within(it.___.app.impl.EhealthApplicationImpl);

before(EhealthSession eheSess) throws AuthorizationException : permissionCheckMethods(eheSess)
{
    Signature sig = thisJoinPointStaticPart.getSignature(); 
    check(eheSess,sig);
}

before(EhealthSession eheSess) throws AuthorizationException : permissionCheckMethods2(eheSess)
{
    Signature sig = thisJoinPointStaticPart.getSignature(); 
    check(eheSess,sig);
}

相关文章

最近看了一下学习资料,感觉进制转换其实还是挺有意思的,尤...
/*HashSet 基本操作 * --set:元素是无序的,存入和取出顺序不...
/*list 基本操作 * * List a=new List(); * 增 * a.add(inde...
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变...
集合的操作Iterator、Collection、Set和HashSet关系Iterator...
接口中常量的修饰关键字:public,static,final(常量)函数...