Announcement Announcement Module
Collapse
No announcement yet.
negate bean PCD Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • miluch
    started a topic negate bean PCD

    negate bean PCD

    Hi

    I have pointcut expression using Spring aop
    Code:
    <aop:pointcut id="valManDaoMethods" expression="bean(*Validator) or bean(*Manager) or bean(*DAO)"/>
    It works great and it matches all methods on beans named *Validator, *Manager and *DAO.
    But, I would like to express pointcut that matches the same beans as above but except for following beans:cacheManager and transactionManager.

    I read from Spring manual that it is possible to negate expression and tried sth like:

    Code:
    <aop:pointcut id="valManDaoMethods" expression=" (bean(*Validator) or bean(*Manager) or bean(*DAO) ) and !bean(cacheManager ) and !bean(transactionManager)"/>
    But it does not work as expected.

    Can anyone help

  • ryanyang
    replied
    you run it on tomcat?

    Leave a comment:


  • ramnivas
    replied
    Fixed it. It is available in the latest nightly build and the upcoming release.

    -Ramnivas

    Leave a comment:


  • miluch
    replied
    I have just created issue number SPR-4860.
    If more info and/or working example is needed pls let me know.
    I hope you can reproduce the issue and provide workaround/solution/patch.

    Leave a comment:


  • ramnivas
    replied
    Please file a bug and I will take a look.

    Leave a comment:


  • SpringingSpringles
    replied
    Originally posted by miluch View Post
    Hi

    I have pointcut expression using Spring aop
    Code:
    <aop:pointcut id="valManDaoMethods" expression="bean(*Validator) or bean(*Manager) or bean(*DAO)"/>
    It works great and it matches all methods on beans named *Validator, *Manager and *DAO.
    But, I would like to express pointcut that matches the same beans as above but except for following beans:cacheManager and transactionManager.

    I read from Spring manual that it is possible to negate expression and tried sth like:

    Code:
    <aop:pointcut id="valManDaoMethods" expression=" (bean(*Validator) or bean(*Manager) or bean(*DAO) ) and !bean(cacheManager ) and !bean(transactionManager)"/>
    But it does not work as expected.

    Can anyone help
    Looks like its a bug in spring-aop. The following doesn't work either

    Code:
    @Pointcut("! bean(sampleServiceImpl)")

    Leave a comment:

Working...
X