• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring AOP AroundAdvice

 
Ranch Hand
Posts: 157
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic