Win a copy of Spark in Action this week in the Open Source Projects 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
  • 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

Can ejbHome Methods be declared as final?

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB Specification clearly states for ejbCreate() and ejbPostCreate() that they cannot be marked final or static.
But for ejbHome methods, it only states that "The method must not be declared as static". So can we declare Home Business methods as final??
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amit,
I guess that should work. Since no other class is going to implement your home interface, so declaring your home business methods should be fine.

Let us know if you write code and test it..

Thanks,
Ugender
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Amit,
Although the spec doesn't mention that the ejbHome methods shouldn't be final, however this doesn't work.I tried the same but the appserver didn't deploy the application.I used Weblogic v8.1.It used to give error at deploy time

Regards,
Paresh Vernekar
 
AmitKumar Jain
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks paresh for verifying the same. I was unable to verify due to tight work schedule.
The only thing that makes this exam tough is these ifs and buts, which really don't matter while at work and then this makes me think whether its worth devoting time on these.
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi AmitKumar Jain,

Methods in an interface can never be marked as 'final',
If you try to do so: the compiler will give you an error.

Good luck!

Herman Scheltinga
 
AmitKumar Jain
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am talking of EJB bean class here and not home interface.
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi AmitKumar Jain,

Sorry for misunderstanding you.

Then I think Ugender Rekulampally is right:
according to the ejb2.0 specs it should be OK.

Herman
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic