aspose file tools
The moose likes Aspect Oriented Programming and the fly likes Spring AOP AroundAdvice Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Aspect Oriented Programming
Reply Bookmark "Spring AOP AroundAdvice" Watch "Spring AOP AroundAdvice" New topic
Author

Spring AOP AroundAdvice

vivek dhiman
Greenhorn

Joined: Aug 05, 2011
Posts: 26

Hi

I have an question, in around advice invoke() function returntype object, what is the use of that object, this object we get after proceed() function. like in my code below.


Please first tell me what is the use of ob and how can i use it or can retrieve it my logic file.

Thanks.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1282

The object depends on the return value of the join point.
If you don't call proceed(), the advised join point is bypassed. proceed() causes the execution of the advised join point, and it will return the same value returned by the advised join point. For example, if you are advising a method that returns a Person object, invoking proceed() will return the same Person object as the advised method.

So in the method you have you would do some stuff before the method was invoked, then you will call proceed(). At that point you have the result of the invocation of the advised method (the object). Now you can do some stuff after the method has been executed optionally using the return value. Once you return the object the original caller will get the result (object)

[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Spring AOP AroundAdvice
 
Similar Threads
toString Doubts
Why The Output Is Same...
finalize help plzzz
how to add an array to an ArrayList
instanceof operator