• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

reply
    Bookmark Topic Watch Topic
  • New Topic