• 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

requirements for session beans

 
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was looking at the session bean example and it says the following -
Any session bean must meet the following requirements -
1) It implements the SessionBean interface
2) The class is defined as public
3) The class cannot be abstract or final
4) It implements one or more ejbCreate methods
5) It implements the business methods
6) It must not define the finalize method
I can understand requirements 1,2,4,5, but not 3 & 6.
3) Why can't we define the class as final?? Does this mean that we can define inheritance hierarchies among the user's bean classes? Where does such need typically arise?
6) I understand the finalize method is called by the garbageCollection API when the instance is being destroyed. Does this mean that all the destruction procedure will be taken care of by the container and hence the user is not allowed to write his own finalize() method??
 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you define your class as final container will not be able to extend the class and provide container services like starting transactions, security check etc.
For finalize question of yours check this
https://coderanch.com/t/311796/EJB-JEE/java/Why-one-define-finalize-method
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the explanation.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic