| 
 | Brooklyn | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectbrooklyn.policy.basic.AbstractEntityAdjunct
brooklyn.policy.basic.AbstractPolicy
brooklyn.policy.ha.ServiceRestarter
public class ServiceRestarter extends AbstractPolicy
attaches to a SoftwareProcess (or anything Startable, emitting ENTITY_FAILED or other configurable sensor), and invokes restart on failure; if there is a subsequent failure within a configurable time interval, or if the restart fails, this gives up and emits ENTITY_RESTART_FAILED
| Field Summary | |
|---|---|
| static BasicNotificationSensor | ENTITY_RESTART_FAILED | 
| static ConfigKey | FAILURE_SENSOR_TO_MONITORmonitors this sensor, by default ENTITY_FAILED | 
| static ConfigKey | FAIL_ON_RECURRING_FAILURES_IN_THIS_DURATIONskips retry if a failure re-occurs within this time interval | 
| static ConfigKey | SET_ON_FIRE_ON_FAILURE | 
| protected java.util.concurrent.atomic.AtomicReference | lastFailureTime | 
| Fields inherited from class AbstractPolicy | |
|---|---|
| policyStatus, suspended | 
| Fields inherited from class AbstractEntityAdjunct | |
|---|---|
| _subscriptionTracker, adjunctType, configsInternal, entity, execution, id, leftoverProperties, name | 
| Constructor Summary | |
| ServiceRestarter() | |
| ServiceRestarter(java.util.Map flags) | |
| ServiceRestarter(ConfigBag configBag) | |
| ServiceRestarter(Sensor failureSensorToMonitor) | |
| Method Summary | |
|---|---|
| protected void | onDetectedFailure(SensorEvent event) | 
| protected void | onRestartFailed(java.lang.String msg) | 
| void | setEntity(EntityLocal entity) | 
| Methods inherited from class AbstractPolicy | |
|---|---|
| destroy, getPolicyType, getRebindSupport, isRunning, isSuspended, resume, suspend, toString | 
| Field Detail | 
|---|
public static final BasicNotificationSensor ENTITY_RESTART_FAILED
@SetFromFlag("failureSensorToMonitor")
@SuppressWarnings("rawtypes")
public static final ConfigKey FAILURE_SENSOR_TO_MONITOR
        
@SetFromFlag("failOnRecurringFailuresInThisDuration")
public static final ConfigKey FAIL_ON_RECURRING_FAILURES_IN_THIS_DURATION
        
@SetFromFlag("setOnFireOnFailure")
public static final ConfigKey SET_ON_FIRE_ON_FAILURE
        
protected final java.util.concurrent.atomic.AtomicReference lastFailureTime
| Constructor Detail | 
|---|
public ServiceRestarter()
public ServiceRestarter(java.util.Map flags)
public ServiceRestarter(ConfigBag configBag)
public ServiceRestarter(Sensor failureSensorToMonitor)
| Method Detail | 
|---|
protected void onDetectedFailure(SensorEvent event)
protected void onRestartFailed(java.lang.String msg)
public void setEntity(EntityLocal entity) {
public void setEntity(EntityLocal entity)
        
Brooklyn Multi-Cloud Application Management Platform 
 brooklyncentral.github.com. Apache License. © 2012.