Announcement Announcement Module
Collapse
No announcement yet.
AOP work flow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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!

      Comment


      • #4
        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.

        Comment


        • #5
          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..

          Comment

          Working...
          X