One of the many EJB programming restrictions in the J2EE spec is = must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast.
- Posted by: rohini bt
- Posted on: April 03 2003 06:54 EST
Could anyone enlighten me as to why this restriction has been defined??
Because the app server is in control of the life-cycle of a bean, it doesn't make sence to start listening to a socket. The bean can be removed from the app server at any time.
The best way to extend the capabilities of your appservers in a managed way is to use the J2EE Connector Architecture. http://www.javaworld.com/javaworld/jw-11-2001/jw-1121-jca.html is a good starting point.
There is an excellent article in WLDJ that covers the reasoning behind the EJB container restrictions as well as valid work arounds. I think the article was prodcued about 6 months ago - www.sys-con.com