You can then invoke your MBean method from the EJB:
Object result = mbeanServer.invoke(objectName, methodName,
params, signature);
And that should not break the rules.
Simone
----- Original Message -----
From: "Alex Sumner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 28, 2003 12:33 PM
Subject: RE: [JBoss-user] Starting threads from session beans
> I can use an MBean, in that I can put my multi-threaded code that does
> the background work into an MBean easily enough. In fact, that's what I
> was planning to do.
>
> But how do I then, from within an EJB method, tell it to do something
> without breaking the rules? I'm thinking maybe I have to make my MBean a
> JCA resource?
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Simone
> Milani
> Sent: 28 March 2003 11:37
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Starting threads from session beans
>
>
> Why not use an MBean?
>
> Simone
> ----- Original Message -----
> From: "Igor Fedorenko" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 28, 2003 10:58 AM
> Subject: RE: [JBoss-user] Starting threads from session beans
>
>
> You can write JCA adapter and do (virtually) anything you want in it. It
> much easier than it sounds...
>
> > -----Original Message-----
> > From: Alex Sumner [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 28, 2003 4:55 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [JBoss-user] Starting threads from session beans
> >
> >
> > Thanks,
> >
> > Wonder if it's permissible to enter a synchronized block? That would
> > give me all I need, just add something to a list, then another thread
> > (pre-existing) can pick it up and do something about it. Otherwise
> > it's MDBs and lots of messages, which is a big overhead for what I
> > need.
> >
> > Cheers,
> >
> > Alex
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Alastair
> > Rodgers
> > Sent: 28 March 2003 09:30
> > To: [EMAIL PROTECTED]
> > Subject: RE: [JBoss-user] Starting threads from session beans
> >
> >
> > No, the EJB 2.0 Spec doesn't permit it. Section 24.1.2 (page 495)
> > states:
> >
> > <quote>
> > The enterprise bean must not attempt to manage threads. The enterprise
>
> > bean must not attempt to start, stop, suspend, or resume a thread; or
> > to change a thread's priority or name. The enterprise bean must
> > not attempt
> > to manage thread groups.
> >
> > These functions are reserved for the EJB Container. Allowing the
> > enterprise bean to manage threads would decrease the Container's
> > ability to properly manage the runtime environment. </quote>
> >
> >
> > Regards,
> > Al.
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On Behalf Of Alex
> > > Sumner
> > > Sent: 27 March 2003 20:15
> > > To: [EMAIL PROTECTED]
> > > Subject: [JBoss-user] Starting threads from session beans
> > >
> > >
> > > Hi,
> > >
> > > Briefly: is it permissible to start a new thread from a thread
> > > running in a session bean?
> > >
> > > I've heard that it isn't allowed, but can't see this explicitly
> > > prohibited in the J2EE specs. More importantly, what will the
> > > consequences be in JBoss? If the session bean thread is in a TX,
> > > would I be correct in assuming the new thread will not be associated
>
> > > with that TX?
> > >
> > > Thanks,
> > >
> > > Alex
> > >
> > >
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by:
> > The Definitive IT and Networking Event. Be There!
> > NetWorld+Interop Las Vegas 2003 -- Register today!
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by:
> > The Definitive IT and Networking Event. Be There!
> > NetWorld+Interop Las Vegas 2003 -- Register today!
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by:
> The Definitive IT and Networking Event. Be There!
> NetWorld+Interop Las Vegas 2003 -- Register today!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by:
> The Definitive IT and Networking Event. Be There!
> NetWorld+Interop Las Vegas 2003 -- Register today!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by:
> The Definitive IT and Networking Event. Be There!
> NetWorld+Interop Las Vegas 2003 -- Register today!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user