I have a webapp (using GlassFish) that uses EJB3/JPA for persistence. It also has to serve some external devices that can connect via TCP.
What is The Right Way to do this?
I have been experimenting with a separate TCP server thread, started from a ContextListener:
However, it seems that it's not possible to inject an EJB Local Interface (with @EJB FooLocal fooLocal;)
in the tread code (my RequestThread class), and setting it up with JNDI lookup is perhaps not The Right
Thing either, it seems that I won't get the neat transaction wrapping of calls to my stateless EJBs,
since they're not managed by the container. A TcpServlet similar to HttpServlet would be neat, but
I don't think there are such animals.