Ashwin asked:

> I like to continue this discussion. Currently I am using WebLogic as an EJB server.
> WebLogic does provide JMS. I am thankful for that.

I really must find the time to test their implementation since I have so
much JMS expertise.  Maybe later next week...

> I want a producer to post a message to a queue. I want this message to be
> picked up asynchronously.
> In order to accomplish this I want to wait inside a method .
>
> I want this wait() method to be invoked with a Bean (mostly a session bean).

This is not typically how you use JMS.  Based on your description, I
do not see why you want to wait inside a particular method....you
would just register a MessageListener (with the onMessage()
method)....and then continue on your merry way, exiting the code if
you need to.  When a message arrives, JMS will fire your onMessage
code and you can process the message.

> According to the Java specification this wait() must be inside a synchronized block
> (no compile time errors but a IllegalMonitorStateException will be
> thrown at run-time).
> Is this a violation of the EJB specification since I am using the
> keyword "synchronized" within my EJB class.

That is not currently allowed in EJB...but I still fail to see why you think
you need to issue the wait at all?

> I am having the SessionBean class implement the MessageListener interface.
> Therefore it will implement the onMessage(String msg) method. This onMessage
> will be invoked by another Thread-call back thread.

The mechanism (and JMS thread) that issues the callback to
onMessage should be transparent to you.

I am not sure if/how WebLogic have integrated EJB and JMS.  The
spec on how to do this is only now being worked upon inside Sun with
it's "Expert" partners.  It could well be that WL's JMS implementation
is not integrated with EJB...in which case you may not be able to mix
the two (due to the EJB threading restrictions).  This is because most
JMS Sessions are implemented with threads (or at least they have
been in the implementations I have been working with).



Andrzej Jan Taramina
Chaeron Consulting Corporation

Chaeron:  - http://www.chaeron.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to