File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Business Method final?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Business Method final??" Watch "Business Method final??" New topic

Business Method final??

Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
Is there any specific reason why the business method in a bean must not be final
shalu saxena

Joined: Jan 18, 2001
Posts: 11
hi rahul ,
i feel that as business methods have to be defined in your bean's remote interface and have to be overridden in the bean class , u can't declare them as final . coz' if they r declared final how will they be overridden .
Asuthosh Borikar
Ranch Hand

Joined: Sep 29, 2000
Posts: 75
The container/server has to implement the stubs and skeletons for the Remote interface of the EJB. The stub resides on the client machine and delegates the method call to the skeleton, which resides in the container. The skeleton interprets the parameters sent to it, and delegates the call to the appropriate business method in the EJB. One of the ways a container can implement this skeleton is to extend the EJB class, and have the method call delegate to the superclass. If the business methods are declared final, the container can no longer extend the EJB class to implement the skeleton. Of course, the skeleton can be implemented in other ways, but I guess Sun decided to leave the decision to the J2EE app.servers.
hanumanth reddy
Ranch Hand

Joined: Jun 12, 2000
Posts: 118

hi rahul
hope u now undertands why the bussiness methds cant be declered final

<a href="" target="_blank" rel="nofollow"></a><br /> 'Add Job To Life'
I agree. Here's the link:
subject: Business Method final??
It's not a secret anymore!