I have an application client which starts up when server is started.  This
client is a timer which causes certain session to execute every 30 seconds
or so.

The problem occurs when I redeploy my application by dropping a new .EAR
file.  While the application is re-deployed, the old client continues to run
along with the instance of the new client.  How can I terminate the old
client when the server re-deployes the application?

I have been thinking about a couple ways, but have not tried any of these
yet:

1. Perhaps the client's main thread will get an InterruptedException when
the server re-deploys.  I can use this to terminate the old client.  This is
just a guess.  I am not sure if this indeed happends.

2. I could setup a socket listener in the client to listen on a particular
port for a quit command.  The new instance would first post a quit command
on that port, and then proceed to take over and listen.  This way, each new
instance will signal to the old one to stop before starting.

Are there better ways to stop an old client?  Hopefully, they will also be
portable.

Thanks.

-------------
-AP_
See my profile at
http://www.myprofiles.com/member/view.do?profileId=128



Reply via email to