JMX - Monitor process existence
I want to be able to monitor a process's existence continuously and restart it if it had crashed or killed for any reason using JMX. Stopping and starting a process is not a probelm as the agent executes a script for it. I can monitor process's existence by implementing heartbeats between the agent and the monitored process but I am looking for something using JMX itself, if s开发者_如何学Comething exists?
You can expose the component as a JMX
managed resource.
Try to do the heartbeat.
If you get instanceNotFound from the managed bean server then it has crashed.
精彩评论