New to J2EE; architecture suggestions for a service/daemon?
Posted
by Kate
on Stack Overflow
See other posts from Stack Overflow
or by Kate
Published on 2010-06-08T15:45:08Z
Indexed on
2010/06/08
15:52 UTC
Read the original article
Hit count: 174
I am brand new to the J2EE world. As an exercise to try and familiarize myself with J2EE, I'm trying to create a tiered web-app, but I'm getting a little stuck on what the best way is to spin up a service in the background that does work.
Paramters of the service:
So the idea is the user presses a button on the web-page, and somewhere on the server a socket connection is opened. For the remainder of the users session (or until the user presses some sort of disconnect button) the socket remains open and pushes received information to some sort of centralized store that servlets can query and return to the user via AJAX.
Is there a J2EE type way to handle this situation? Naturally what I would think to do is to just write a Java application that listens on a port that the servlets can connect to and spawns new threads that open these sockets, but that seems very ad-hoc to me.
(PS: I am also new to Stack Overflow, so forgive me if it takes me some time to figure the site out!)
© Stack Overflow or respective owner