File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Advice PointCut methods not being called? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Advice PointCut methods not being called?" Watch "Advice PointCut methods not being called?" New topic

Advice PointCut methods not being called?

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 850
I have no idea, why AudienceAdvice joinpoint methods are not being called.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
<bean id="kenny" class="Instrumentalist">
<property name="instrument" ref="instrument"></property>
<bean id="instrument" class="Saxophone"></bean>

<bean id="audience" class="Audience"></bean>
<bean id="audienceadvice" class="AudienceAdvice">
<property name="audience" ref="audience"></property>

<bean id="audiencearoundadvice" class="AudienceAroundAdvice">
<property name="audience" ref="audience"></property>

<bean id="performancePointCut" class="">
<property name="pattern" value=".*"></property>

<bean id="audienceAdvisor" class="">
<property name="advice" ref="audienceadvice"></property>
<property name="pointcut" ref="performancePointCut"></property>

<bean id="audienceAdvisor1" class="">
<property name="advice" ref="audienceadvice"></property>
<property name="pattern" value=".*perform"></property>

SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog-
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 850
Finally i got it solved.

[Removed not nice comment. Mark Spritzler]
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

FYI, it looks like you are testing out the code from the Spring in Action book. And to let you know that that book is based mostly on Spring 2.0 version. While a lot of that book is still relevant, some of the examples are "older" way of doing things.

For instance in your Advice class, you are now tied to Spring because of the interfaces that you implemented. Where the more POJO clean way is to create a class and add either xml aop tags to declare your joinpoints or with Annotations. This keeps your "Aspect" class a pure Java object.

Here is the xml way

And here is the Annotation way

Good Luck


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Advice PointCut methods not being called?
It's not a secret anymore!