aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes TCP/IP,socket connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "TCP/IP,socket connection" Watch "TCP/IP,socket connection" New topic
Author

TCP/IP,socket connection

Nancy King
Ranch Hand

Joined: Jan 06, 2003
Posts: 30
Hello,friends:
I have a question regarding to the swing and web application.
Senario:
The swing application is used to monitor some activities happened in web application. For example, when a user is login the web application, a signal is showed in swing application the a user has login the web application.

The way I am thinking to implement is as following:
Using event and event listenet---When a user login, an event is generated from the web application. The swing application listens to the event, and perform some actions to show the signal. in order to have swing application receive event generated from web application, I think a connection between swing application and web application(localhost) should be established.

My Question:
1. How can I establish the connection between swing application and web application(assume web application and swing application is in the same machine).
2. Is the event-event listener approach correct in the above senario?
I really appreciate all your help and suggestions.
Best regards,
Nancy
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Nancy,
Considering that both VMS are on the same machine (I am assuming that the web application is a servlet/JSP app) then I would suggest using RMI. The initial setup for both ends of the plumbing is a little more difficult than a pure socket solution, but once done then sending and receiving events is as simple as it is in a single VM.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
gautham kasinath
Ranch Hand

Joined: Dec 01, 2000
Posts: 583
RMI is the best bet.. have the same worked out in a listerner/observer pattern where the call back to the swing application is thru RMI.
Regds
Lupo


"In the country of the blind, the one eyed man is the King"
Gautham Kasinath CV at : http://www.geocities.com/gkasinath
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TCP/IP,socket connection
 
Similar Threads
EJB 2.1 - Database connection for multiple users in Entity Bean (BMP)
Struts with security how to question
installation..
swing and web application
WSDL question