[jboss-user] [JBossWS] - Re: Multithreading in Jboss 4.0.1

oskar.carlstedt do-not-reply at jboss.com
Thu Oct 18 02:39:27 EDT 2007


Hi!

The most correct way to do this is to write your own MBean/Service. AFAIK threads are not allowed inside an EJB (some application servers will allow threads in the EJB). So writing your own MBean that will take care of multithreading might solve your problem.

Creating MBeans is about adding a new service entry in you jboss-app.xml that will point out a your-service.xml file.

You MBean javacode must implement an interface s.a. YourServiceMBean (Notice the pattern interface name ends with MBean, the implementation does not);
mbean interface: YourServiceMBean
mbean impleementation: YourService

You are looking up MBeans in the same way as you do with an EJB with the 
iniCtx.lookup(...)

The MBean has some life cycle methods that you might want to use:
start(), stop(), ... Start is called when the service is deployed. Check the JBoss application server documentation for more details.


Hope this can help you.
Cheers
/Oskar


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096383#4096383

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4096383



More information about the jboss-user mailing list