File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes Needs help for AoP implementation with Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Needs help for AoP implementation with Spring" Watch "Needs help for AoP implementation with Spring" New topic

Needs help for AoP implementation with Spring

Yao Mingming

Joined: Dec 05, 2006
Posts: 2
This is my very first time to use Spring. I'm having trouble in my AoP implementation. What I�m doing is simple: one interface called Knight with one method getMyFavouratePizza(), the implementation of this interface is KnightImpletation. To feel Spring's AoP, I am going to add a simple logging feature to the getMyFavouratePizza() method by AoP, therefore, I use MethodBeforeAdvice interface here. But the result is frustrating. It seems that the AoP has never been invoked by Spring. The following is my xml configuration file: (note: I'm using NameMatchMethodPointcut for the PointCut, but when I change to RegexpMethodPointcutAdvisor, it's the same. Nothing happens.)

Just wondering if miss anything here. Or could anyone help me out?

<?xml version="1.0" encoding="UTF-8"?>
<bean id="knightTarget" class="com.knight.KnightImpletation">
<property name="pizzaStrore">
<ref local="pizzaMaker"/>

<bean id="pizzaMaker" class="com.knight.DominoPizza">

<bean id="knightLogAdvice" class="com.knight.KnightBeforeInterceptor"/>

<bean id="knightLogAdvisor" class="">
<property name="mappedName">
<property name="advice">
<ref bean="knightLogAdvice"/>

<bean id="knight" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<property name="interceptorNames">
<ref bean="knightLogAdvisor"/>
<property name="target">
<ref bean="knightTarget"/>

I agree. Here's the link:
subject: Needs help for AoP implementation with Spring
It's not a secret anymore!