The session Management should be easily done in a web server ( because of the
Servlet API). But if you have to session Management in client/Server environment, where the
Java Class is listening in a particular port rather then a web server and a client is a swing client, then things get little messy. One way , we can do session management in this kind of client/server environment is, when a client connects to the server , the server could give a unique ID to the client and the client could pass the ID whenever it is taking to the Server. It is like you are taking care of the Session Management in your program.
I hope this helps. If anyone knows a better way, let me know