• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@ExcludeClassInterceptors annotation

 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thank for confirmation. Like to know any other way to exclude life-cycle callback interceptors at class level or application (default) level interceptors.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic