Results 1 to 5 of 5

Thread: AOP work flow

  1. #1
    Join Date
    Dec 2012
    Posts
    11

    Default AOP work flow

    Hi,

    Is there anyone here who knows what class does the schema-based AOP calls when we use
    Code:
    <aop:config>,<aop:pointcut>, <aop:advisor> and <aop:aspect>
    tags? I am confused whether it use aspect-j' classes. I need the package and class.

    Thank you!

    regards,
    Louie

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

    Default

    Why not simply ask the question.

    Yes they use aspectj classes as the pointcut is an aspectj pointcut and aspectj classes are used to parse those. If however you only use an aop:advisor without a pointcut then it doesn't use aspectj. Basically is depends on your configuration.
    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
    Dec 2012
    Posts
    11

    Default

    Thank for your reply sir. Assuming this configuration (I got this from http://www.tutorialspoint.com/spring...op_appoach.htm)

    Code:
     
    <aop:config>
       <aop:aspect id="myAspect" ref="aBean">
          <aop:pointcut id="businessService"
             expression="execution(* com.xyz.myapp.service.*.*(..))"/>
         
          <aop:around pointcut-ref="businessService" 
             method="doRequiredTask"/>
       ...
       </aop:aspect>
    </aop:config>
    
    <bean id="aBean" class="...">
    ...
    </bean>
    How does the dispatcherServlet knows that every time a method is called from the package com.xyz.myapp.service, doRequiredTask method of aBean will be executed? If I understand it correctly,it looks for the pointcut expression I defined and acts like an interceptor because of the around advice defined. . But how? What specific class of aspectj contains this implimentation?

    I hope I've clearly stated my question.

    Thank you!

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

    Default

    What specific class of aspectj contains this implimentation?
    None... It is a spring class, spring only uses AspectJ to parse the expression for the remainder it uses its own AOP solution to execute interceptors. Also the dispatcherservlet doesn't know anything about this as the interceptors are applied in an unobtrusive way.
    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
    Dec 2012
    Posts
    11

    Default

    Oh I see, aspectJ was used only to parse the expression. So defining an advice allows it to intercept every method call? What class does this advice uses? Thank you for your reply..

Posting Permissions

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