com.caucho.health.predicate
Class IfNotRecent

java.lang.Object
  extended by com.caucho.health.predicate.AbstractHealthPredicate
      extended by com.caucho.health.predicate.IfNotRecent
All Implemented Interfaces:
HealthActionListener, HealthActionAware, HealthPredicate

@Configurable
public class IfNotRecent
extends AbstractHealthPredicate
implements HealthActionAware, HealthActionListener

Qualifies an action to match at most an amount of time after the last execution.

<health:HttpStatusHealthCheck ee:Named="httpStatusCheck">
   <url>http://localhost:8080/test-ping.jsp</url>
 </health:HttpStatusHealthCheck>
 
 <health:DumpHeap>
   <health:IfHealthCritical healthCheck="${httpStatusCheck}"/>
   <health:IfNotRecent time='5m'/>
 </health:DumpHeap>
 


Constructor Summary
IfNotRecent()
           
 
Method Summary
 void afterAction(HealthAction action, HealthService healthService)
           
 void beforeAction(HealthAction action, HealthService healthService)
           
 void init()
           
 boolean isMatch(HealthEvent healthEvent)
          The abstract match returns true, so a child can combine its own matches with the parent.
 void setAction(HealthAction action)
           
 void setTime(Period time)
          The time before the action can execute again.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IfNotRecent

public IfNotRecent()
Method Detail

init

@PostConstruct
public void init()

setAction

public void setAction(HealthAction action)
Specified by:
setAction in interface HealthActionAware

setTime

@Configurable
public void setTime(Period time)
The time before the action can execute again.

Parameters:
time -

beforeAction

public void beforeAction(HealthAction action,
                         HealthService healthService)
Specified by:
beforeAction in interface HealthActionListener

afterAction

public void afterAction(HealthAction action,
                        HealthService healthService)
Specified by:
afterAction in interface HealthActionListener

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 AbstractHealthPredicate

toString

public java.lang.String toString()
Overrides:
toString in class AbstractHealthPredicate