Win a copy of High Performance Python for Data Analytics this week in the Python 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

ejbCreate IN MDB

 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why is ejbCreate in MDB not a pert of MessageDriven interface ?
 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, an educated guess could be that the designers didn't even want to open the risk of MDB creation being performed on demand
In any case even the maintenance & expansion of the EJB pool for MDBs is controlled "anonymously" by the container - no where we ask explicitly for a MDB instance. However if you need the notification, you can still have one ejbCreate() inside bean code, right?
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Well, an educated guess could be that the designers didn't even want to open the risk of MDB creation being performed on demand


Can you explain more?
 
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pradeep,
the mdb is supposed to conform to the asynchronous handling of request by any subscriber. So only the OnMessage() method is invoked by the container whenevr a new message arrives. The creation of MDB's is totally container managed, the clients of MDB does not have control on the creation/destruction of it. I believe as a result it does not make sense putting ejbCreate() in MessageDriven interface
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I believe as a result it does not make sense putting ejbCreate() in MessageDriven interface


What is the problem if ejbCreate is in the interface? Let the container call this method.
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For that matter,none of the beans,have a ejbCreate method defined in their javax.ejb.xxxBean interfaces.
 
Pradeep bhatt
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sivasundaram Umapathy:
For that matter,none of the beans,have a ejbCreate method defined in their javax.ejb.xxxBean interfaces.


Yes, I know that. You cannot define it for entity and SFSB for obvious reasons.
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic