Interesting proposal... The ejb spec requires all access to ejbeans be
done via proxy (container), but says nothing about direct access to bean
components (at least I don't think).
If you want to pursue this further, perhaps you should have the bean
component subscribe/unsubscribe during callbacks to set/removeEntityContext;
this way you are guaranteed the correct InitialContext, and that messages
are received only when the bean is active!
If this doesn't work, trying messaging ejb via JMS proxy, as described
nicely (with source code) in the current issue of JDJ:
http://www.sys-con.com/java/archives/0506/grant
Or use EJB 2.0's MessageBeans!
Good luck!
Gene Chuang
[EMAIL PROTECTED]
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
To: [EMAIL PROTECTED]
Sent: 7/5/00 10:31 PM
Subject: Can an EJB contain JMS subscribers?
Folks,
If I have an enterprise bean (session or entity) which in turn is
composed
of several other objects, is it acceptable for those objects to
subscribe
to JMS messages? Is this behaviour portable between application
servers?
Can the contained objects simply get the InitialContext by instantiating
it
(in the same way that the bean class does - in EJB 1.1 anyway) and then
getting the JMS provider - or would the InitialContext have to be handed
to
them by the bean class?
I'm doubtful, since this seems to break restrictions EJB places upon
multithreading... but let me know what you think!
Regards,
James W.
------------------------------------------------------------------------
--
Visit us at Cards Australia 2000 on Stand 31A. Cards Australia will be
held at the Melbourne Convention Centre from July 4-6 2000.
------------------------------------------------------------------------
--
This e-mail is from Cards Etc Pty Ltd (ACN: 069 533 302). It may contain
privileged and confidential information. It is intended for the named
recipient(s) only. If you are not an intended recipient, please notify
us
immediately by reply e-mail or by phone on +61 2 9212 7773 & delete this
e-mail from your system.
------------------------------------------------------------------------
--
========================================================================
===
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".
===========================================================================
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".