• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

About the important notes on p.118 of Ivan's notes

 
Ranch Hand
Posts: 1738
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On p.118 of Ivan's notes, the important notes :


When there are multiple interceptors of the same kind, for instance for post-construct life cycle events, a interceptor chain is built and the first interceptor method in the chain is invoked by the container.


But what I observe is all post-construct interceptors are called, not only the first interceptor method:


Output on the console:


LogInterceptor - constructor
Info: MyDefaultInterceptor.postContruct
Info: LogInterceptor.postContruct
Info: MyAroundInvokeInterceptor.postContruct
Info: *** SingletonSessionBeanA - initialized



MyAroundInvokeInterceptor is the second interceptor in the chain, but it is still invoked to intercept the @PostConstruct method in the SingletonBeanA.
 
Creator of Enthuware JWS+ V6
Posts: 3287
296
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But what I observe is all post-construct interceptors are called, not only the first interceptor method


That is correct, and that is what he says in the next paragraph:

If an interceptor method takes an InvocationContext object parameter, then the proceed() method must be invoked in this object, in order for the other interceptors in the chain to be invoked.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!