2009/1/11 SKS <[email protected]>: > I have a thick swing client used by users to perform actions. Business logic > is on server and exposed as CXF web services. I have a requirement where > Admin user can see list of connected user and disconnect them for some > reason , if required. I want a communication alert to be shown on > disconnection so that they can save their changes.
When you say connected/disconnected -- is there actually any sort of permanent connection between the client and server? Or is "connected" just essentially shorthand for "web services will respond to client's requests"? > Can anybody advise me a good solution ..I can implement it many ways like > background thread continiously checking with webservice & sleeping for some > time and checking again , HTTP connection to servlet etc. I want to put an > optimize solution to ensure that it should not affect performance of client > & server both. Hard to say much without knowing more about the system, but your first suggestion seems fairly sound. Maybe with an operation called something like getTimeToDisconnect -- if it returns null, the background thread just sleeps for a preset interval, if it returns a positive integer N the client warns the user "You will be disconnected in N seconds". You'd have to decide on the right two values to use (thread sleep interval, and initial disconnect notification time) based on how many users you have, how many WS requests the server is handling, etc. If you wanted to optimize it *slightly* you could use a plain old HTTP GET instead of a real SOAP op, but that might add extra complexity to your codebase, since presumably you're already using SOAP for the real services. Don't know if this is the best way but it would be my first solution to try... Andrew. -- New site launched: http://biotext.org.uk/ I am retiring my old email addresses. Please use [email protected] (i.e. andrew) in the future.
