stella.error
Class ResetFinalizer
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.AbstractErrorFinalizer
stella.xml.XMLErrorFinalizer
stella.error.ResetFinalizer
- All Implemented Interfaces:
- Cloneable, ErrorFinalizing, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
public class ResetFinalizer
- extends XMLErrorFinalizer
This finalizer replaces a pure XMLErrorFinalizer for errors that
are allowed to occur at a certain frequency, but are then replaced by an
alternate sequence. Additionally to the parent class, this finalizer has
an KEY_ALTERNATEFILE sequence specified, which is an alternate
sequence to load, pointing to a file in the same way as the
XMLErrorFinalizer.KEY_XMLFILE does. Each time an error with the appropriate follow-up
is encountered, it's occurence time is stored in a list. If the
number of appropriate errors received within KEY_INTERVAL
exceeds KEY_MAXNUMBER, then the alternate sequence is loaded.
Note that further occurences of the error might nevertheless spark
the original sequence to be executed, if the error frequency cools down
accordingly.
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from interface util.PropertySupplying |
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
KEY_ALTERNATEFILE
public static final String KEY_ALTERNATEFILE
- The xml-file to load if error-frequency is too high.
- See Also:
- Constant Field Values
KEY_ALTERNATETYPE
public static final String KEY_ALTERNATETYPE
- The type of the alternate sequence.
- See Also:
- Constant Field Values
KEY_INTERVAL
public static final String KEY_INTERVAL
- The base time intervall.
- See Also:
- Constant Field Values
KEY_MAXNUMBER
public static final String KEY_MAXNUMBER
- The maximum number of errors occured within the base time interval.
- See Also:
- Constant Field Values
DEFALTERNATEFILE
private static final String DEFALTERNATEFILE
- A file holding the shutdown sequence. Last resort of error handling.
- See Also:
- Constant Field Values
DEFALTERNATETYPE
private static final String DEFALTERNATETYPE
- A file holding the shutdown sequence. Last resort of error handling.
- See Also:
- Constant Field Values
DEFINTERVAL
private static final long DEFINTERVAL
- The default time intervall, in ms.
- See Also:
- Constant Field Values
DEFMAXNUMBER
private static final int DEFMAXNUMBER
- The default maximum number of occurences within the time interval.
- See Also:
- Constant Field Values
times
private List times
- A list of error-occurence times.
ResetFinalizer
public ResetFinalizer(Map prop)
- Constructs a new reset finalizer. Defaults the interval to 5 minutes
at a frequency of 0.033333Hz.
finalizeError
public boolean finalizeError(TargetDefinition src,
ErrorEvent ee,
CommandLaunching[] dummy,
Sequencing seq,
ParameterClustering set)
- The incomming errors. First, the error-time is recorded and stored in
the
times list. From this occurence time, all outdated entries
from the times list are deleted. If the size of the list is then still
larger then KEY_MAXNUMBER, the alternate sequence
KEY_ALTERNATEFILE is loaded and executed using its
KEY_ALTERNATETYPE style.
- Specified by:
finalizeError in interface ErrorFinalizing- Overrides:
finalizeError in class XMLErrorFinalizer