-
1. Getting inside the "container"
philani Apr 6, 2011 2:03 AM (in response to drathnow)Socket listening inside the container is nor recommended, but you could do socket listening inside the init() method of a servlet.
-
2. Re: Getting inside the "container"
drathnow Apr 6, 2011 11:28 AM (in response to philani)Well, I think that's my point. I'm listening outside the container and would like to get back inside the container when a connection/datagram arrives.
Can you expand a little on why listening inside the container is a bad idea? I've been running this application in Jboss for 3 years and haven't had any problems with the approach I'm using.
-
3. Getting inside the "container"
genman Apr 6, 2011 5:40 PM (in response to drathnow)1 of 1 people found this helpfulI've done many services that only spoke TCP (not HTTP).
By DI, I assume you mean CDI. And so this is more of a CDI/Weld question, but I'll try to answer.
Basically, what the container does is activate CDI contexts as part of HTTP request handling. You can do this yourself by obtaining a reference to the BeanManager through JNDI. I don't really know much more than this. I suppose you can look at the source code (get yourself a stack trace) and see how, say, RequestScope is activated.
-
4. Getting inside the "container"
drathnow Apr 7, 2011 12:43 AM (in response to genman)Okay. So lets say I get the BeanManager and then use it to get some object and all it's dependent objects. What are the ramifications of then passing that object to another thread?