How to serve a socket from a Java EE application?

jakarta-ee, java, jboss, sockets

Solution

Right now I implement a workaround:

alt text http://yuml.me/7f82bd5c

I use a standalone java application that accepts tcp calls from the client and forwards them as JNDI calls to the application server.

Problem

We would like to serve some client requests within our Java EE application server (JBoss 4.2.3). I read that the Java EE spec doesn't allow opening a socket from an enterprise bean. But the spec suggests no alternatives. Specifically, enterprise beans should not: - listen on, accept connections on, or multicast from a network socket So the question is: What can I do to serve some binary tcp based protocols (not http) from within an application server? Here someone suggests to implement a resource adapter. Is this the way you have to go or are there other (easier) solutions?

Original source