| Author |
Exceptions in lifecycle callback methods (I)
|
Ralph Jaus
Ranch Hand
Joined: Apr 27, 2008
Posts: 342
|
|
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 ]
|
SCJP 5 (98%) - SCBCD 5 (98%)
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
In an interceptor callback, you usually call proceed() to propagate the call down the chain. This is where you can catch an exception.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Ralph Jaus
Ranch Hand
Joined: Apr 27, 2008
Posts: 342
|
|
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 ]
|
 |
 |
|
|
subject: Exceptions in lifecycle callback methods (I)
|
|
|