com.caucho.health.check
Class HttpStatusHealthCheck

java.lang.Object
  extended by com.caucho.health.check.AbstractHealthCheck
      extended by com.caucho.env.health.HttpStatusHealthCheckImpl
          extended by com.caucho.health.check.HttpStatusHealthCheck
All Implemented Interfaces:
HealthCheck
Direct Known Subclasses:
PingThread

@Singleton
@Configurable
@Named
public class HttpStatusHealthCheck
extends HttpStatusHealthCheckImpl

Monitors one or more URLs on the current Resin instance by making an HTTP GET request and comparing the returned HTTP status code to a pattern.

Generates CRITICAL if the HTTP GET request failed to connect or the status code does not match the regexp. http://localhost:8080/test-ping.jsp


Constructor Summary
HttpStatusHealthCheck()
           
 
Method Summary
 void addUrl(java.lang.String url)
          Adds a new URL to be tested.
 void init()
          Initialize the pinger.
 void setPingHost(java.lang.String pingHost)
          Sets the server's ping host
 void setPingPort(int pingPort)
          Sets the server's ping port (default 80)
 void setRegexp(java.util.regex.Pattern regexp)
          Set the HTTP status regular expression (default "200")
 void setSocketTimeout(Period period)
          Sets the socket connection timeout (default 10 seconds)
 
Methods inherited from class com.caucho.env.health.HttpStatusHealthCheckImpl
checkHealth, checkPing, getPingHost, getPingPort, getRegexp, getSocketTimeout, getUrls, readResponse, setSocketTimeout, toString
 
Methods inherited from class com.caucho.health.check.AbstractHealthCheck
findDelegate, getDelegate, getName, isEnabled, setEnabled, setName, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpStatusHealthCheck

public HttpStatusHealthCheck()
Method Detail

init

@PostConstruct
public void init()
Description copied from class: HttpStatusHealthCheckImpl
Initialize the pinger.

Overrides:
init in class HttpStatusHealthCheckImpl

setPingHost

@Configurable
public void setPingHost(java.lang.String pingHost)
Sets the server's ping host

Overrides:
setPingHost in class HttpStatusHealthCheckImpl

setPingPort

@Configurable
public void setPingPort(int pingPort)
Sets the server's ping port (default 80)

Overrides:
setPingPort in class HttpStatusHealthCheckImpl

addUrl

@Configurable
public void addUrl(java.lang.String url)
Adds a new URL to be tested.

Overrides:
addUrl in class HttpStatusHealthCheckImpl

setSocketTimeout

@Configurable
public void setSocketTimeout(Period period)
Sets the socket connection timeout (default 10 seconds)


setRegexp

@Configurable
public void setRegexp(java.util.regex.Pattern regexp)
Set the HTTP status regular expression (default "200")

Overrides:
setRegexp in class HttpStatusHealthCheckImpl