Is concurrent code in JMX services allowed?
The EJB 3.1 Spec. states:
The enterprise bean must not attempt to manage threads.
The JBoss EJB 3 Extensions Referen开发者_如何学Cce states:
[JMX services] are singleton beans...
So I reason:
- Using a multithreaded 3rd-party lib in a JMX Service is not conform to the Spec.
- A JMX service is a wrapper for a EJB 3.1 Singleton Bean with additional management capabilities provided through the JMX console.
Am I right?
JBoss AS will (currently!) not prevent the use of threads in an EJB.
A JMX service (MBean) is not related to EJB; threads are allowed in JMX.
@Service beans are implemented with a JMX wrapper. They are a proprietary extension to EJBs and so do not conform to the EJB spec. They are kind of a hybrid between EJBs and JMX MBeans.
@Service beans are not related to EJB 3.1 Singleton Beans. Although being similar, they were around before EJB 3.1 existed.
精彩评论