File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Interceptors in ejb 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Interceptors in ejb 3.0" Watch "Interceptors in ejb 3.0" New topic

Interceptors in ejb 3.0

Lalit mishra
Ranch Hand

Joined: Sep 01, 2005
Posts: 100
1. If i use Interceptors in a Session bean or MDB
then the interceptors would be applied to all
business methods?
2. If i want to apply inteceptors to only one business methods
how can i achieve it ?

Tridib Samanta
Ranch Hand

Joined: Apr 28, 2004
Posts: 128
When the @Interceptors annotation is applied to an individual method, that interceptor is executed only when that particular method is invoked. If you use the @Interceptors annotation on the bean class, all interceptor classes listed will interpose on every method invocation of every business method of the EJB

Thanks, Tridib
SCJP 1.4, SCWCD 1.4, SCBCD 5.0
I agree. Here's the link:
subject: Interceptors in ejb 3.0
It's not a secret anymore!