File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Exceptions in lifecycle callback methods (I) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Exceptions in lifecycle callback methods (I) " Watch "Exceptions in lifecycle callback methods (I) " New topic
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: 14687
    
  16

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exceptions in lifecycle callback methods (I)
 
Similar Threads
Exceptions in lifecycle callback methods (II)
LifeCycle Callback interceptor question
Chained exception
Lifecycle callback interceptor
Multiple life-cycle Callback methods per class