No Threads in EJBContainer:
Running threads in the EJBContianer context is an EJB Specification violation.
Possible Reasons:
EJBContainer provides various services like Object pooling, transaction and etc. If a thread is run in an EJB component the EJBContainer looses the control over the component instances as thread can block on an Object. This may create inconstant behavior of the server.
Solution: WorkManager – JSR 237
- WorkManager is a joint specification from BEA & IBM to standardize the process of creating and managing container managed threads.
- These threads are none other than the normal java thread with the only difference, the thread is created using JNDI reference and the lifecycle of the thread is managed by the container itself.
- This specification is supported from Weblogic 9.X versions and IBM WebSphere Application Server 6.X.
WorkManager:
Basic Components of WorkManager Implementation are,
- WorkManager
- Work
- WorkListener
- WorkItem
- RemoteWorkItem
- WorkEvent

Class Diagram
References:
http://jcp.org/en/jsr/detail?id=237
http://edocs.bea.com/wls/docs90/javadocs/commonj/work/WorkManager.html
http://www.devx.com/Java/Article/28815
No comments:
Post a Comment