• 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

Where is EjbCreate() declared??

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,
I am unable to find the Interface/Class which has an EjbCreate() method
declared.
It is a compulsion on the EB to implementb it though...
Please help
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that is one of the weirder things of EJB. It's a requirement according to the specification but there's no single interface that declares it.
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to EJB Spec. You will not find ejbCreate()/ejbCreate(.....) method
in any of the Interface(Session,Entity,MessageDriven as well as in EJBHome &
EJBObject).According to Specification whatever create() method you write in
Home Interface there has to be corresponding (Signaturewise)ejbCreate() in
Bean class...thats it....try to remove create() from Home Interface...'ejbc'
will give you error...then you write create() in Home iNterface but comment
out corresponding ejbCreate() in Bean class ...again 'ejbc' will shout.
Thats why..create()/ejbCrate() is not present in any of the
interface.........

If above discussion is misleading/confusing.............follow the next few
lines

Do you agree that for each create() in Home Interface there has to be
Corresponding ejbCreate() in Bean class?

Now how these interfaces could predict what kind of ejbCreate() you are
going to write.....no argument ejbCreate()/parameterized one (& How many
parameters,what about sequence)...you can write parameterized create(hence
ejbCreate())in SFSB,CMP,BMP..right

Hope this helps.....Correct me if i am wrong..


Shrinivas
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When i am referring to ejbc i am assuming Weblogic Serevr..
 
Ashutosh Limaye
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying Sir....

Upon seeing the Docs I realised that SessionBean,EntityBean and Message
DrivenBean all have an EjbRemove() method declared..
I find it obvious because removing an object from memory is a
common functionality of calling a GC on that object.

So could it be something like the way of creating an Ejb differs from
server to server.....hence they did not generalize it....where as removing
the Ejb is a common task....???

Please Reply...
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no, that's not the reason.
The reason is that there is no way to predict the exact signatures of the ejbCreate methods. They may have (depending on bean type) arguments of whatever type as needed and defined by the bean developer, which means there's no way to put them in a generic interface.
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Jeroen ..Bingo......


Ashutosh: Try to understand Life cycle of each EJB, perhaps it would give u clear idea about the same..as well as what activities are done on server side when client invoke any Business logic method of EJB (Except MDB).


Shriniwas
 
Ashutosh Limaye
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey....
I got the point,

This confusion arised because I was always under impression that
if you want to force some rules ...write an Interface.
Hence when I read that it is a compulsion on the part of EB developer
to give a definition ....It must be forced by some interface.....

I may be wrong....forgive me.
 
There's a city wid manhunt for this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic