This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Modern JavaScript for the Impatient and have Cay Horstmann on-line!
See this thread for details.
Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

@ExcludeClassInterceptors annotation

 
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
 
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.
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic