File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Setting up interceptors to be invoked after a business method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Setting up interceptors to be invoked after a business method." Watch "Setting up interceptors to be invoked after a business method." New topic
Author

Setting up interceptors to be invoked after a business method.

Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
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.
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
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).

SCJP 5 (98%) - SCBCD 5 (98%)
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Thanks Ralph, I didn't aware of that before
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting up interceptors to be invoked after a business method.