Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Need confirmation from experts.

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/**
* Call back methods cannot declare to throw Checked Exception.
* If done the bean will not be deployed and will generate an
* error as incorrect callback signature.
*
* Callbacks can declare to throw RuntimeException. If
* PostConstruct throws a RuntimeException, the bean instance
* is destryoed and PreDestroy method is not invoked.
*/
/**
* Business method can be declared to throw Checked exception.
* The bean instance is not removed from service.
* @throws Exception
*/
/**
* Business method can be declared to throw Runtime exception.
* When the business method throws Runtime exception, PreDestroy
* is invoked before the instance is destroyed.
* @throws RuntimeException
*/


Please confirm, if the above statements are correct. I have verified them before coming up with these points.
I just want to confirm with the experts.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 1st,2nd and 3ed statements are correct.

4th statement is wrong.

If the bean instance method ( Business or lifecycle callback method ) throws runtime exception, @PreDestroy callback method will not be called. It will be missed

-------------------------------------
LakshmiNarayana Kodali
SCJP 5(98%), SCWCD(100%), SCBCD in progress
 
I am displeased. You are no longer allowed to read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!