File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes Ping Server Status & Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Ping Server Status & Action" Watch "Ping Server Status & Action" New topic

Ping Server Status & Action

Tarun Trehan
Ranch Hand

Joined: Mar 16, 2012
Posts: 51

Hi All,

I have a blog site for which i need to check the status and send an alert if the blog is not up and running.
I need to repeat this task every 30 minutes(configurable in code). Though i have couple of other questions which i can come to later; my initial one is that:
"If the server has not been started/not responding , there is problem and i should get a notification/alert for it.
I wrote the java code for this. However, whenever the server is not started, i do not get a proper response code; instead i get a "Connect Exception".
Hence, i have to call the alert/notification code from an exception."
Is that correct (to initiate a business scenario from a catch block) or am i missing something here ??

Following are some code snippets.

Tarun Trehan (
Tarun Trehan
Ranch Hand

Joined: Mar 16, 2012
Posts: 51


Appreciate a response and inputs on this query.
I agree. Here's the link:
subject: Ping Server Status & Action
It's not a secret anymore!