Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting up interceptors to be invoked after a business method.  RSS feed

 
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

EJB 3 In Action wrote:As you know, in EJB 3 you can set up interceptors that are invoked before and after (around) any EJB business method.



I couldn't understand that how can we setup an interceptor to be invoked after a business method.
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book doesn't just say "after" but "before and after (around)". If in the following example


the business method test is called, the output will be

before invocation of test
test
after invocation of test

So, its around the business method. But you can't perform the around invoke method during execution of the business method (as it would be desirable for logging issues, for example).
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ralph, I didn't aware of that before
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!