• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbCreate IN MDB

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is ejbCreate in MDB not a pert of MessageDriven interface ?
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • 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: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • 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?
 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • 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: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic