• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Exceptions in lifecycle callback methods (I)

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

the ejb core spec says (12.4.2, page 307):

A lifecycle callback interceptor method may catch an exception thrown by another lifecycle callback interceptor method in the invocation chain

Has anybody an example on how this works ?

For example, given the following interceptor class How would a lifecycle callback method in a following interceptor class catch myException ?
[ October 21, 2008: Message edited by: Ralph Jaus ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In an interceptor callback, you usually call proceed() to propagate the call down the chain. This is where you can catch an exception.

 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Christophe, now it's clear.

So if there are lifecycle callback interceptors
then the interceptor chain works (in principal) like
Now the usual java exception handling can be applied.
[ October 22, 2008: Message edited by: Ralph Jaus ]
 
Bring out your dead! Or a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic