File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exceptions in lifecycle callback methods (I)

 
Ralph Jaus
Ranch Hand
Posts: 342
  • 0
  • 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 ]
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • 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
  • 0
  • 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic