This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes @ExcludeClassInterceptors annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "@ExcludeClassInterceptors annotation" Watch "@ExcludeClassInterceptors annotation" New topic
Author

@ExcludeClassInterceptors annotation

Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

I have interceptor class. In it one @PostConstruct method is defined. I am attaching this interceptor class to one stateless session bean. In the Stateless session bean there is also one @PostConstruct method is defined.

When executing both the post construct methods are executing. I want to suppress execution of post construct method in interceptor class, so I use @ExcludeClassInterceptors annotation to the PostConstruct method defined in bean class. But still both method are executing.

Is it a right approach ? Is the @ExcludeClassInterceptors applicable to life-cycle methods, or simply ignored ?

The bean class is



and the Interceptor class is


Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Benoît de Chateauvieux
Ranch Hand

Joined: Aug 10, 2007
Posts: 183
The Javadoc defines ExcludeClassInterceptors as "Used to exclude class-level interceptors for a business method."

I ran your example and I think interceptors are ignored for life-cycle methods.


SCJP5 | SCBCD5 | SCEA5 Part 1
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

Thank for confirmation. Like to know any other way to exclude life-cycle callback interceptors at class level or application (default) level interceptors.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @ExcludeClassInterceptors annotation
 
Similar Threads
Session Beans and SessionBean interface.
Problem in understanding session beans
EJB3 mock questions available now! (Section 2)
Multiple life-cycle Callback methods per class
Multiple postconstruct and predestroy methods.