I want to implement following solution (described in a image) using Java Web Services
When ever a user request with a valid credentials using web services , a session is created over server and that server (who receives the request ) creates a connection with the other server i.e. Meta Trader's Server.
Here each user has a different session to maintain their connection and a state with meta trader server.
Note: Currently i am not maintaining any session when a user request instead i am saving the connection object in a
@javax.ws.rs.core.Context
ServletContext servletContext;
MyApplication application = new MyApplication();
servletContext.setAttribute("application", application);
But this solution doesn't serve multiple users naturally. so please anyone has an idea how to solve the issue of serving multiple clients then please reply.
I am using Glassfish and JAX-RS ( Jersery 1.1 ) , JAXB