Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

requirements for session beans  RSS feed

 
Jayadev Pulaparty
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??
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • 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
http://www.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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!