File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes AOP declared without indicating when the advice to be fired Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "AOP declared without indicating when the advice to be fired" Watch "AOP declared without indicating when the advice to be fired" New topic
Author

AOP declared without indicating when the advice to be fired

Naresh Shanmugam
Ranch Hand

Joined: Jul 16, 2010
Posts: 76
I saw <aop:config> having <aop:pointcut> and <aop:advisor> but there is nothing like <aop:before> / <aop:after> / <aop:around> / <aop:after-returning> / <aop:after-throwing>. Just Wondering at what point of time the advice will be invoked. Any body have any idea on this?

The code is shown below:

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

Well, it looks like a performance monitor that you wouldn't want running in production, but something you can turn on or off at anytime when you need it.

Maybe they have a console that they can go to to turn it on to run <aop:before>

There is more missing than what was posted. Also in Transactions configured with xml there isn't an <aop:before> etc to configure that. But I don't think that is why in your case.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Naresh Shanmugam
Ranch Hand

Joined: Jul 16, 2010
Posts: 76
Mark, This code is logging the amount of time taken to execute each method. There is a single method called "invokeUnderTrace(final MethodInvocation invocation, final Logger logger)" in the "PerformanceInterceptor", which is being called. I did not turn ON anything. Is there any thing like default method which gets called when neither of this <aop:before> / <aop:after> / <aop:around> / <aop:after-returning> / <aop:after-throwing> is given??
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

Naresh Shanmugam wrote:Mark, This code is logging the amount of time taken to execute each method. There is a single method called "invokeUnderTrace(final MethodInvocation invocation, final Logger logger)" in the "PerformanceInterceptor", which is being called. I did not turn ON anything. Is there any thing like default method which gets called when neither of this <aop:before> / <aop:after> / <aop:around> / <aop:after-returning> / <aop:after-throwing> is given??


I think the term interceptor gives you your answer. You are intercepting calls with an Interceptor.

Mark
Naresh Shanmugam
Ranch Hand

Joined: Jul 16, 2010
Posts: 76
Mark,

You mean to say since we are using PerformanceMonitorInterceptor the "intercept()" method in it would be called automatically.
Please correct me if I am wrong.
 
 
subject: AOP declared without indicating when the advice to be fired
 
Threads others viewed
getting $Proxy0 cannot be cast exception
Transaction demarcation works with TransactionProxy but not AOP
Spring Transaction by AOP
Spring AOP + AspectJ Weaving ?
Spring Transaction
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture