Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.FailureRecovery
Class RecoveryStrategy

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.FailureRecovery.RecoveryStrategy
All Implemented Interfaces:
Configurable, Resettable, Telemeterable
Direct Known Subclasses:
LocalRecoveryActions, SystemResetOnConfigurationError, SystemResetOnTooManyFailures

public class RecoveryStrategy
extends AocsObject

This is the base class for recovery strategies. A failure recovery strategy is a set of coordinated responses to the failure events in the failure event repository. Unlike recovery actions, that act on individual failure reports, recovery strategies can take into considerations several failure reports and can therefore offer a higher-level response to failures.

The key method in this class is doRecovery() that inspects the event repository and implements the appropriate failure recovery response. Its implementation thus encapsulates an application-specific response to a set of failure reports. It represents a framework hot-spot (recovery strategy hot-spot).

Failure strategies can be chained together. This allows several failure strategies to be implemented in sequence.

Recovery strategies can be enabled or disabled and the enable status can be changed dynamically.

Recovery strategies are responsible for creating recovery events and this class therefore maintains a list of listeners to recovery events and offer a method to fire recovery events.

Copyright: see the Copyright Notice.

Version:
1.0
Author:
Alessandro Pasetti (University of Konstanz)
See Also:
The Failure Recovery Framelet Document., FailureEvent, FailureEventRepository, RecoveryAction, RecoveryEvent

Field Summary
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
RecoveryStrategy()
          This component should not be used before having set the maximum number of listeners to recovery events and having loaded the failure event repository.
 
Method Summary
 void addRecoveryListener(RecoveryListener l)
          Initialization method to register listeners to recovry events.
 void doRecovery()
          Calling this method will cause the recovery strategy to be executed.
protected  void fireModeEvent(short eventTypeId, RecoveryAction action)
          Fire a recovery event to all registered listeners.
 FailureEventRepository getFailureEventRepository()
          Recovery strategies operate on a failure event repository.
 RecoveryStrategy getNextRecoveryStrategy()
          Return the next recovery strategy.
 int getTelemetryImageLength()
          Return the length (in bits) of the telemetry image of the object.
 boolean isConfigured()
          Return false if some configuration data are missing.
 boolean isEnabled()
          Return true if the recovery strategy is enabled, otherwise false.
 void removeRecoveryListener(RecoveryListener l)
          Initialization method to unregister recovery event listeners.
 void reset()
          Set the state of the recovery strategy to 'enabled'.
 void resetConfiguration()
          Unload the next recovery strategy in the chain.
 void setEnabled(boolean enabledStatus)
          Recovery strategies can be dynamically enabled and disabled.
 void setFailureEventRepository(FailureEventRepository r)
          Recovery strategies operate on a failure event repository.
 void setMaxNumberOfRecoveryListeners(int n)
          Initialization method to set the maximum number of listeners to recovery events.
 void setNextRecoveryStrategy(RecoveryStrategy r)
          Recovery strategies can be linked in chains.
 void writeToTelemetry(TelemetryStream tmStream)
          Direct the object to write its own state to the telemetry stream.
 
Methods inherited from class RtjAocsFramework.BasicObjects.AocsObject
addConfigurationListener, addFailureListener, finalize, getAocsClock, getConfigurationListenerList, getCycle, getDestructionRecoveryAction, getFailureListenerList, getSystemManager, getTelemetryFormat, getTime, removeConfigurationListener, removeFailureListener, reportConfigurationEvent, reportFailure, resetStaticConfiguration, setAocsClock, setDestructionRecoveryAction, setMaxNumberOfConfigurationListeners, setMaxNumberOfFailureListeners, setSystemManager, setTelemetryFormat
 
Methods inherited from class RtjAocsFramework.BasicObjects.RootObject
getClassId, getInstanceId, setClassId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecoveryStrategy

public RecoveryStrategy()
This component should not be used before having set the maximum number of listeners to recovery events and having loaded the failure event repository.

Method Detail

setMaxNumberOfRecoveryListeners

public void setMaxNumberOfRecoveryListeners(int n)
Initialization method to set the maximum number of listeners to recovery events. Attempts to call it more than once will result in a configuration error being generated.


doRecovery

public void doRecovery()
Calling this method will cause the recovery strategy to be executed. Conceptually, this should be an abstract method. Its implementation in the base class for all recovery strategies simply performs the forwarding of the doRecovery() call to the next recovery strategy in the chain of linked recovery strategies.


resetConfiguration

public void resetConfiguration()
Unload the next recovery strategy in the chain.

Specified by:
resetConfiguration in interface Configurable
Overrides:
resetConfiguration in class AocsObject

isConfigured

public boolean isConfigured()
Description copied from interface: Configurable
Return false if some configuration data are missing.

Typically, a false value indicates that a plug-in component is missing or that the object has not been initialized. This is a negative check only: a return value of true cannot guarantee that the object is correctly configured.

Calls to resetConfiguration on an object A are normally not propagated objects of type AocsObject that are contained or otherwise aggregated to A. The rationale for this policy is that all objects of type AocsObject implement interface configurable and therefore their configuration status should be checked externally (probably through the configuration check service of the system manager).

Specified by:
isConfigured in interface Configurable
Overrides:
isConfigured in class AocsObject

reset

public void reset()
Set the state of the recovery strategy to 'enabled'.

Specified by:
reset in interface Resettable
Overrides:
reset in class AocsObject

setNextRecoveryStrategy

public void setNextRecoveryStrategy(RecoveryStrategy r)
Recovery strategies can be linked in chains. After a recovery strategy has executed its own strategy, it calls the next recovery strategy in the chain.


getNextRecoveryStrategy

public RecoveryStrategy getNextRecoveryStrategy()
Return the next recovery strategy.


setFailureEventRepository

public void setFailureEventRepository(FailureEventRepository r)
Recovery strategies operate on a failure event repository.


getFailureEventRepository

public FailureEventRepository getFailureEventRepository()
Recovery strategies operate on a failure event repository.


setEnabled

public void setEnabled(boolean enabledStatus)
Recovery strategies can be dynamically enabled and disabled. When doRecovery() is called on an strategy that is disabled, no strategy is taken (but the call is still passed to the next recovery strategy in the chain). By default, at creation, recovery strategies are enabled.


isEnabled

public boolean isEnabled()
Return true if the recovery strategy is enabled, otherwise false.


writeToTelemetry

public void writeToTelemetry(TelemetryStream tmStream)
Description copied from interface: Telemeterable
Direct the object to write its own state to the telemetry stream.

Specified by:
writeToTelemetry in interface Telemeterable
Overrides:
writeToTelemetry in class AocsObject

getTelemetryImageLength

public int getTelemetryImageLength()
Description copied from interface: Telemeterable
Return the length (in bits) of the telemetry image of the object. This method is useful to verify that the quantity of data generated by a given object is compatible with the capacity of the telemetry channel.

Specified by:
getTelemetryImageLength in interface Telemeterable
Overrides:
getTelemetryImageLength in class AocsObject

addRecoveryListener

public void addRecoveryListener(RecoveryListener l)
Initialization method to register listeners to recovry events.


removeRecoveryListener

public void removeRecoveryListener(RecoveryListener l)
Initialization method to unregister recovery event listeners.


fireModeEvent

protected void fireModeEvent(short eventTypeId,
                             RecoveryAction action)
Fire a recovery event to all registered listeners. The recovery event stores the recovery action and the recovery strategy.


Real-Time Java AOCS Framework v1.0 API Specification

Real-Time Java AOCS Framework project home page

Automatic Control Laboratory, ETH Zuerich
Physikstrasse 3
CH-8092 Zuerich, Switzerland