Announcement Announcement Module
Collapse
No announcement yet.
Jdk requirment on following schema based aop Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jdk requirment on following schema based aop

    Does using the schema based aop require any aspectj jar. such as aspectjrt.jar and aspectjweaver.jar files and jdk 5 and above. The reason for having this question is because of this

    <aop:config>
    <aopointcut id="businessService"
    expression="execution(* com.xyz.myapp.service.*.*(..))"/>
    </aop:config>

    this requires that you have jdk 5 and aspectj jars

    but can I use this same above with jdk 1.4 , but for defining expression for pointcut what would I use, since the above pointcut expression requires jdk 5.


    spring doc says this following but not working for me


    If you are using the schema based declaration style with Java 5, you can refer
    to named pointcuts defined in types (@Aspects) within the pointcut expression, but this feature is not available
    on JDK 1.4 and below (it relies on the Java 5 specific AspectJ reflection APIs). On JDK 1.5 therefore, another
    way of defining the above pointcut would be:Following requires that you use jdk 1.5 of defining the above point cut would be

    <aop:config>
    <aopointcut id="businessService"
    expression="com.xyz.myapp.SystemArchitecture.busin essService()"/>
    </aop:config>

    Question is will schema based aop will work with jdk 1.4 with above point cut expression thanks , if it doesn't work what is the solutions ,to fall back to 1.2 based aop

    thanks

  • #2
    The schema based approach is designed for jdk 1.4. As long as you use the first sample you posted. You cannot point to pointcuts in classes, because that requires annotations.

    The basic schema works on JDK 1.4, you will need the aspectj jar on your classpath to let it work (it uses AspectJ to parse the pointcut expressions).

    Comment

    Working...
    X