aspose file tools*
The moose likes Aspect Oriented Programming and the fly likes Spring AOP AroundAdvice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Aspect Oriented Programming
Bookmark "Spring AOP AroundAdvice" Watch "Spring AOP AroundAdvice" New topic
Author

Spring AOP AroundAdvice

vivek dhiman
Ranch Hand

Joined: Aug 05, 2011
Posts: 130

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: 1680
    
    7

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://aspose.com/file-tools
 
subject: Spring AOP AroundAdvice