开发者

How can I implement a simple heart-beat sensor in java that responds when another application is shut-down

开发者 https://www.devze.com 2023-04-04 11:54 出处:网络
I got a GWT version of the java Pet Store workin开发者_开发百科g on my machine, and I\'d like to implement an exteneral Java program that is on another machine, and just displays \"On\" or \"off\" - s

I got a GWT version of the java Pet Store workin开发者_开发百科g on my machine, and I'd like to implement an exteneral Java program that is on another machine, and just displays "On" or "off" - so when I turn off the java Pet Store on one machine, it will then switch from "On" to "Off" on the other machine.

How would I go about doing this? I've played with RMI a little, but it's quite cumbersome. Any tips or advice is appreciated.


I'd create a program to check the running processes on the Pet Store machine to see if the application is still running and expose that capability to remote machines.

-Checking whether Pet Store is still running

-Executing the check remotely

It may be a bit overkill, but if you wanted, you could set up the remote check using web services. I personally like Axis2.


If it's a web app, just use something like HttpClient to hit a known address; if you don't get a response, it's down.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号