• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Message Driven beans

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
just confused.
1)Are MDBs used only with entitybeans.
2)Exactly in what type of situations are these usedcan someone explain with a small example.
3)Iam confused with difference between Topcis(durable & nondurable),queues
thanks in advance.
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Message Driven Beans and Entity Beans are two different things and are not necessarily used together. Message Driven beans are used for asynchronous communications. This way, a client can call a method on an mdb and continue doing other things. Session and Entity Beans are synchronous. That means that after a client calls a method on one of them, it has to wait until they it returns something before the client can continue. Topics are for a publish-subscribe functionality, where I can send a message to a topic and it can be received by anyone listening in (kindof like a chat room post). Queues are for point to point communications where I send a message to only one listener.
 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Anthony:

Originally posted by Anthony Watson:
This way, a client can call a method on an mdb and continue doing other things. Session and Entity Beans are synchronous. That means that after a client calls a method on one of them, it has to wait until they it returns something before the client can continue.


It is not the case that a "client calls a method on one of them". Clients will NEVER call a method on a MDB because it can not get a reference to it. It is the container's job to call the onMessage() method of the bean when appropriate as well as the lifecycle methods. It is true though that the client will not be blocked after sending a message.
Hope this helps.
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You know what I mean, Keith. You will run out of breath and get carple tunnels syndrome if you use the precise, long winded way of describing the ejb process. I still feel that I answered the guy's question.
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Anthony:

Originally posted by Anthony Watson:
You know what I mean, Keith. You will run out of breath and get carple tunnels syndrome if you use the precise, long winded way of describing the ejb process. I still feel that I answered the guy's question.


In this field, precision is a neccesity. If you say A, I will not assume you mean B. I also beleive in being concise but not at the expense of clarity.
Peace
[ January 15, 2004: Message edited by: Keith Rosenfield ]
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Keith Rosenfield:
Hey Anthony:
In this field, precision is a neccesity. If you say A, I will not assume you mean B. I also beleive in being concise but not at the expense of clarity.


Howdy folks. I think I have to agree with Keith on this point, for *this* forum (as opposed to the regular non-certification EJB forum, where I think Anthony's "shorthand" is exactly the way we discuss things in the real world.)
But it has definitely been my experience that if you say something that might be *parsed* a little differently by someone who is new to the technology, people *will* be confused. I know because I make some of those shortcuts myself in the book, and I always end up getting lots of (justified) questions and complaints.
So if I *say* "a client calls an MDB" there will definitely be newcomers who will be confused into thinking, "wait a minute... if an MDB does not have a component interface, then how does this happen?" We have to assume that there are people who are still in the learning stages and may be in the most basic level of understanding. Or, there may be folks just coming in from EJB 1.1 and so they really have no prior knowledge or experience with the new things like local interfaces or MDBs.
Anthony, you give such awesome and detailed explanations. They *are* very clear... except for the occasional shorthand. So I'd like to second what Keith said and suggest that you risk a little more carpal tunnel and assume that in THIS forum, there might be hundreds of lurkers who are at square one, and will take your words literally. So if you say, "client has a reference to a bean..." they'll take it to mean "client has a reference to an instance of a bean".
It has been very hard for me, for example, to try to get into the habit of *always* saying, "Client has a reference to an entity bean's component interface..." (especially since I came from EJB 1.1, were there the "component" interface was known only as "the remote interface").
Anyway, I think you're doing a TON to help people out here. I think I've picked up a few things from your explanations that I can really use, so thank-you. I also think Keith is doing a really good job of smoking out all those confusing or seemingly contradictory corners of the spec (or my book ).
Thanks again to everyone who has been answering questions and ESPECIALLY to those brave enough to ask them
Remember: there ARE no dumb questions.
cheers,
kathy
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic