public class SequenceErrorFinalizer extends AbstractErrorFinalizer implements ErrorFinalizing
XMLSequencer. It is
used to handle a single KEY_FOLLOWUP by loading an alternate
sequence with ResourceSupplying.KEY_URLRESOURCES and
KEY_XMLFILE. Depending on
KEY_TYPE, this new sequence is inserted into the running sequence
in one of three ways.
ABORT: The normal sequence is aborted and replaced with the
new one. This error-handling method is normally used for severe errors
where recovery is not possible.APPEND: The sequence derived from the error-recovery steps
is appended to the current sequence. This means that error handling is
delayed until the last command in the normal sequence has been completed.
This error handling is more a clean-up procedure.PREPEND: he sequence derived from the error-recovery steps
is prpended to the current sequence. This means that error handling
occurs as the next set of commands. This error handling is ment for
errors that may be solved with retries.ErrorFinalizing instance has to be coded.| Modifier and Type | Class and Description |
|---|---|
private class |
SequenceErrorFinalizer.ErrorDistributor
Helper class to speed up the return from the error listener method
ErrorListener.errorOccured(stella.ErrorEvent). |
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
static String |
ABORT
A constant indicating replacement of the non-error sequence.
|
private SequenceErrorFinalizer.ErrorDistributor |
alternate
The thread handling the sequence update.
|
static String |
APPEND
A constant defining appending of the error-handling sequnce.
|
private static String |
DEFFOLLOWUP
The default follow-up.
|
private static String |
DEFTYPE
The default behaviour.
|
private static String |
DEFXMLFILE
A file holding the shutdown sequence.
|
static String |
KEY_FOLLOWUP
The follow-up action.
|
static String |
KEY_TYPE
The way of insertion into the running sequence.
|
static String |
KEY_XMLFILE
The sequence file to load.
|
static String |
PREPEND
A constant defining prepending of the error-handling sequnce.
|
KEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
SequenceErrorFinalizer(Map<String,String> prop)
Constructs a new simple error handler.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
finalizeError(TargetDefinition ignore,
ErrorEvent ee,
CommandLaunching[] dummy,
Sequencing seq,
ParameterClustering set)
The incomming errors.
|
String |
getFollowUp()
Gets the follow-up this error finalizer works on.
|
boolean |
isAborting()
Returns true if this error finalizer is acting on a
ErrorEvent.ABORT_TARGET follow-up and is currently finalizing. |
boolean |
isFinalizing()
Returns if this error finalizer is still working on the last error.
|
protected boolean |
startRecovery(URL xml,
String type,
Sequencing<SequenceStep> seq)
Starts the sequence-updating thread.
|
createErrorFinalizer, init, setMonitor, wakeclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetMonitordefaultBoolean, 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, stringPropertiespublic static final String KEY_XMLFILE
public static final String KEY_TYPE
public static final String KEY_FOLLOWUP
public static final String ABORT
public static final String APPEND
public static final String PREPEND
private static final String DEFXMLFILE
private static final String DEFFOLLOWUP
private static final String DEFTYPE
private SequenceErrorFinalizer.ErrorDistributor alternate
public boolean finalizeError(TargetDefinition ignore, ErrorEvent ee, CommandLaunching[] dummy, Sequencing seq, ParameterClustering set)
Sequencing.abort(java.util.List<E>),
Sequencing.append(java.util.List<E>) , or Sequencing.prepend(java.util.List<E>).
To ensure quick return of this method, a seperate thread is started,
see SequenceErrorFinalizer.ErrorDistributor.finalizeError in interface ErrorFinalizingprotected boolean startRecovery(URL xml, String type, Sequencing<SequenceStep> seq)
isFinalizing() method.public String getFollowUp()
getFollowUp in interface ErrorFinalizingpublic boolean isFinalizing()
SequenceErrorFinalizer.ErrorDistributor is non-null and alive.isFinalizing in interface ErrorFinalizingpublic boolean isAborting()
ErrorEvent.ABORT_TARGET follow-up and is currently finalizing.isAborting in interface ErrorFinalizingisAborting in class AbstractErrorFinalizer