Announcement Announcement Module
Collapse
No announcement yet.
Is it possible to advise a particular named bean? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to advise a particular named bean?

    Hi
    Is it possible to restrict advice to only a particular named bean, i.e. to a bean with id "xyz"? I want to apply different advice depending on the bean instance.
    Or alternatively, in an advice, can I find out the id of the bean being advised?
    Thanks

  • #2
    If you use proxy based AOP, it should not have to be any problem. I don't know if this is possible with AspectJ (bytecode weaving).

    Comment


    • #3
      In spring 2.1 there is a bean element for the pointcut definition language so you could use that. Or use the 'old' proxy based spring 1.2 way and you shouldn't have a problem either.

      Comment


      • #4
        Originally posted by Alarmnummer View Post
        If you use proxy based AOP, it should not have to be any problem. I don't know if this is possible with AspectJ (bytecode weaving).
        Thanks.
        I do use proxy based AOP.
        Can you be more explicit? I couldn't find anything in the documentation or by searching the Web.

        Comment


        • #5
          Originally posted by mdeinum View Post
          In spring 2.1 there is a bean element for the pointcut definition language so you could use that. Or use the 'old' proxy based spring 1.2 way and you shouldn't have a problem either.
          Thanks.
          Can you be more explicit? I couldn't find anything in the documentation or by searching the Web.

          Comment


          • #6
            Does this help you ? http://static.springframework.org/sp...-api-autoproxy

            Comment


            • #7
              Originally posted by Andrei Stefan View Post
              Perfect!
              Thank you very much.

              Comment

              Working...
              X