Results 1 to 7 of 7

Thread: applying aspectj to OpenSessionInViewFilter

  1. #1
    Join Date
    Dec 2008
    Posts
    14

    Default applying aspectj to OpenSessionInViewFilter

    Hello,

    I have a tracing (around) aspect that would time the execution time of the methods. I'd like to apply that to OpenSessionInViewFilter class. However my aop.xml is being read after the classloading of the above class. I was wondering if there was a trick to apply this tracing aspect to classes outside my webapp. Is that possible? I must also mention that I'm doing LTW with aspectj.

    Thanks for the help,
    Ramin
    Last edited by ramin; Nov 11th, 2010 at 05:42 PM. Reason: added clarification

  2. #2
    Join Date
    Nov 2010
    Posts
    15

    Default

    Non-spring managed classes can be dependency injected with the help of aspectj and the spring annotation @Configurable.
    But such classes have to be available to byte-code instrumentation.

    I think, it should be possible to further enrich such classes, annotated with @Configurable, with aspects.

  3. #3
    Join Date
    Dec 2008
    Posts
    14

    Default

    The question is: how can I apply AOP (aspectJ) to the classes that are not part of my webapp but do belong to the container (tomcat in this case).

  4. #4
    Join Date
    Nov 2010
    Posts
    15

    Default not possible

    then it is not possible

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

    Default

    Well it is possible but you would have to switch to loadtime weaving with the full blown aspectj solution instead of proxy based aop..
    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

  6. #6
    Join Date
    Dec 2008
    Posts
    14

    Default

    Well, I am already doing that. LTW with true aspectJ AOP. The question is how do i expose classes that are not part of my webapp (basically the container classes) to aspectJ? And how do I tell aspectJ to weave those classes.

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

    Default

    Yyou are using loadtime weaving in your application NOT the whole container.. You should enable/configure it for the whole container (I suggest a read of the aspectj reference guide on how to do that, it requires a java-agent.).
    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

Posting Permissions

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