Another approach, one that would be portable among app server implementations (if that's of interest to you) would be to build a Java EE connector (also known as a resource adapter). This is the Java EE-compliant way of building connectivity to the outside world other than directly-supported sources of information such as databases, message queues, and web U/Is.
You can build what is referred to as an inbound connector to accept incoming messages on the socket and deliver them to an MDB (message-driven bean) for processing.
- Tim
[Message sent by forum member 'tjquinn' (tjquinn)]
http://forums.java.net/jive/thread.jspa?messageID=251067