Results 1 to 7 of 7

Thread: BeanNameAutoProxyCreator, <aop:advisor/> and Ordered...

  1. #1
    Join Date
    Mar 2007
    Posts
    561

    Default BeanNameAutoProxyCreator, <aop:advisor/> and Ordered...

    Hi,

    I have a SecurityMethodInterceptor which is called by a BeanNameAutoProxyCreator.
    And I have an AuditInterceptor (simple MethodInterceptor) which I have configured via an <aop:advisor/> element.

    Both implements the Ordered interface.

    The strange thing is, that my order properties have no effect on the order of the execution of the interceptors.
    getOrder() is never called and so it is clear that this property has no effect.

    Is this a bug? I'm using Spring 2.0.5 and acegi 1.0.3.

    Thank you.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    It isn't a bug it is a result of your configuration.

    You have 2 proxy mechanisms each creates a proxy, so the order is based on the proxy creator. Either use a BeanNameAutoProxyCreator for all your aop/proxy stuff or use an aop block for everything. I suggest the latter...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Mar 2007
    Posts
    561

    Default

    Now I'm using only <aop:config/> and it works.

    Thank you!

    About the order:

    Am I right with this order?:

    tx:annotation-driven: 1
    AuditInterceptor: 2
    SecurityInterceptor: 3


    This should ensure that a transaction is always in place and any exception thrown by my SecurityInterceptor goes always through my AuditInterceptor.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    You're welcome, I'm glad it works.

    The order depends on your needs, judging by your description it looks fine.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Mar 2007
    Posts
    561

    Default

    One question about the MethodInterceptor.
    Is there a way how I can find out, what the target object is?

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Not sure what you want. Can you elaborate?
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #7
    Join Date
    Mar 2007
    Posts
    561

    Default

    I meant MethodInvocation#getThis().
    Strange name...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •