com.caucho.health.predicate
Class IfCron

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

@Configurable
public class IfCron
extends AbstractScheduledHealthPredicate

Matches if the current time is in an active range configured by cron-style times. This can be used both to schedule regular actions or to prevent restarts or other actions during critical times.

<health:HttpStatusHealthCheck ee:Named="httpStatusCheck">
   <url>http://localhost:8080/test-ping.jsp</url>
 </health:HttpStatusHealthCheck>
 
 <health:Restart>
   <health:IfHealthCritical healthCheck="${httpStatusCheck}"/>
   <health:IfRechecked/>
   <health:Not>
     <health:IfCron>
       <enable-at>0 17 * * *</enable-at>
       <disable-at>0 18 * * *</disable-at>
     </health:IfCron>
   </health:Not>
 </health:Restart> 
 


Constructor Summary
IfCron()
           
 
Method Summary
 void init()
           
 boolean isMatch(HealthEvent healthEvent)
          True if the predicate matches.
 void setDisableAt(CronType disableAt)
          Sets the cron disable times.
 void setEnableAt(CronType enableAt)
          Sets the cron enable times.
 void setValue(CronType enableAt)
           
 
Methods inherited from class com.caucho.health.predicate.AbstractHealthPredicate
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IfCron

public IfCron()
Method Detail

setEnableAt

@Configurable
public void setEnableAt(CronType enableAt)
Sets the cron enable times.


setValue

@Configurable
public void setValue(CronType enableAt)

setDisableAt

@Configurable
public void setDisableAt(CronType disableAt)
Sets the cron disable times.


init

@PostConstruct
public void init()

isMatch

public boolean isMatch(HealthEvent healthEvent)
True if the predicate matches.

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