• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

requirements for session beans

 
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the explanation.
 
They weren't very bright, but they were very, very big. Ad contrast:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic