dcsimg
how OnMessage() works
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   praveen_jain
Posted On:   Thursday, September 13, 2007 10:17 AM

hi
i know when a message arrive in queue, every time
onMessage() method is invoked,
so what special onMessage() is having that cause it invoke.
how it is invoked ? hw queue knows when to invoke onmessage() method,

Re: how OnMessage() works

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, October 5, 2007 08:05 PM

I think it's a "registered callback", to use generic pattern kind of terms, right?



You "register" -- you make a call that tells the queue manager, basically, to call your class's onMessage, when an appropriate message arrives. And the queue manager decides how and when to call ("callback") your class's method.



It's an example of "Inversion of Control", sort of, too, to use another generic pattern kind of term. you don't write the "control thread"; that's the queue manager's responsibility. instead, you "invert" by letting the control thread invoke your method.
About | Sitemap | Contact