com.caucho.health.predicate
Class IfMessage

java.lang.Object
  extended by com.caucho.health.predicate.AbstractHealthPredicate
      extended by com.caucho.health.predicate.AbstractScheduledHealthPredicate
          extended by com.caucho.health.predicate.AbstractHealthCheckPredicate
              extended by com.caucho.health.predicate.IfMessage
All Implemented Interfaces:
HealthPredicate

@Configurable
public class IfMessage
extends AbstractHealthCheckPredicate

Qualifies an action to match health result message to a regular expression.

<health:HttpStatusHealthCheck ee:Named="httpStatusCheck">
   <url>http://localhost:8080/test-ping.jsp</url>
 </health:HttpStatusHealthCheck>
 
 <health:Restart>
   <health:IfHealthCritical/>
   <health:IfMessage healthCheck="${httpStatusCheck}" regexp="Exception"/>
 <health:Restart>
 


Field Summary
protected  java.util.regex.Pattern _regexp
           
 
Constructor Summary
IfMessage()
           
IfMessage(java.util.regex.Pattern regexp)
           
 
Method Summary
 boolean isMatch(HealthEvent healthEvent)
          The abstract match returns true, so a child can combine its own matches with the parent.
 void setRegexp(java.util.regex.Pattern regexp)
          Set health message match regular expression
 
Methods inherited from class com.caucho.health.predicate.AbstractHealthCheckPredicate
getHealthCheck, getLastResult, setHealthCheck, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_regexp

protected java.util.regex.Pattern _regexp
Constructor Detail

IfMessage

public IfMessage()

IfMessage

public IfMessage(java.util.regex.Pattern regexp)
Method Detail

setRegexp

@Configurable
public void setRegexp(java.util.regex.Pattern regexp)
Set health message match regular expression


isMatch

public boolean isMatch(HealthEvent healthEvent)
Description copied from class: AbstractHealthPredicate
The abstract match returns true, so a child can combine its own matches with the parent. See AbstractScheduledCheckPredicate for a case where the parent isMatch doesn't return true.

Specified by:
isMatch in interface HealthPredicate
Overrides:
isMatch in class AbstractScheduledHealthPredicate