|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
stella.AbstractErrorHandler
stella.MasterErrorHandler
public class MasterErrorHandler
A collection of ErrorFinalizing objects.
Incoming error messages are queried for their
required follow-up action. A lookup table is then used to match the required
follow-up action to an ErrorFinalizing object. The error is now
passed to the ErrorFinalizing.finalizeError(stella.TargetDefinition, stella.ErrorEvent, stella.CommandLaunching[], stella.Sequencing, stella.ParameterClustering) method which should
return fast and does all necessary steps to recover from the error. If
recovery fails for any reason, i.e. if ErrorFinalizing.finalizeError(stella.TargetDefinition, stella.ErrorEvent, stella.CommandLaunching[], stella.Sequencing, stella.ParameterClustering)
returns false, or if the error received cannot be matched to a
finalizer, the fatalError(stella.ErrorEvent) method is called.
Additionally, errors related to Handable targets are treated.
Whenever a TargetDefinition is started using the
startTarget(stella.TargetDefinition)
method, it is copied into the current list. PickConnected
errors are then first assigned to the most currently started target. If
this target has parents that are additionally in the current list,
the error is propagated up until either no further parent is assigned to a
target or if the parent in question is not in the current list. Targets
may react to this errors with abort or retries, see e.g.
DOMTarget.
| Nested Class Summary | |
|---|---|
protected class |
MasterErrorHandler.NoneErrorFinalizer
A default finalizer class for ErrorEvent.NONE follow-ups. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private List<TargetDefinition> |
current
A list of currently started targets for PickConnected errors. |
private static String |
DEFPICKREPLACE
Per default, we use a mail finalizer on pick-realated errors. |
private Map<String,ErrorFinalizing> |
handle
A lookup table linking follow-ups to error handlers. |
private boolean |
ignore
A boolean indicating that incoming error should be ignored. |
static String |
KEY_HANDLERS
The key to the coma-separated list of error finalizers. |
static String |
KEY_PICKREPLACE
Pick connected errors with NONE get a different error handler. |
static String |
KEY_REMOTE
The key to the remote error casters. |
static String |
KEY_WEATHER
The key to the remote weather caster. |
private Sequencing |
sequencer
A link to the main sequencer. |
private CommandLaunching[] |
servers
A link to the command servers. |
private ParameterClustering |
set
A link to the main parameter set. |
private WeatherSurveying |
weather
The local weather station if any. |
| Fields inherited from class util.rmi.AbstractRmiListener |
|---|
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAY |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
MasterErrorHandler(Map<String,String> prop)
Constructs a new simple error handler. |
|
| Method Summary | |
|---|---|
protected boolean |
deregisterAtCaster(RmiCaster caster,
Class service)
Adds the ability to deregister at rmi-weather casters. |
boolean |
doAbort()
Returns true if the error handler is dealing with a target abort. |
void |
endTarget(TargetDefinition end)
Removes a target from the error-handlers current list. |
void |
errorOccured(ErrorEvent ee)
The incomming errors. |
void |
exit()
Signals that the error handler is shuting down and incoming errors should be ignored. |
private void |
fatalError(ErrorEvent ee)
This error handler is invoked when everything else fails. |
void |
init()
Registers at a remote weather caster to tranform bad weather events into BadWeather and GoodWeather errors. |
private void |
notifyTargets(ErrorEvent ee,
ErrorFinalizing finish,
ParameterClustering set)
If a PickConnected error was registered, the list of currently
active targets is traversed. |
protected boolean |
registerAtCaster(RmiCaster caster,
Class service)
Adds the ability to register at rmi-weather casters. |
void |
registerCluster(ParameterClustering cluster)
Registers the parameter cluster. |
void |
registerLauncher(CommandLaunching[] device)
Registers the command servers. |
void |
registerMonitor(Object sleeper)
Registers the monitor. |
void |
registerSequencer(Sequencing seq)
Registers the command sequencer. |
void |
registerWeather(WeatherSurveying fake)
Registers a local weather station to the error handler. |
void |
rmiErrorOccured(ErrorEvent ee)
This method is invoked by remote error casters. |
void |
rmiWeatherChanged(WeatherEvent we)
Handles weather events. |
void |
setEnabled(boolean accept)
Enables the error handler, meaning that incoming errors are no longer ignored. |
void |
startTarget(TargetDefinition start)
Adds a target to the handler's current list. |
void |
weatherChanged(WeatherEvent we)
Handles weather events. |
| Methods inherited from class stella.AbstractErrorHandler |
|---|
createErrorHandler |
| Methods inherited from class util.rmi.AbstractRmiListener |
|---|
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBinding |
| Methods inherited from class util.rmi.RmiPropertyContainer |
|---|
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, 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, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.rmi.RmiEventListener |
|---|
getListenerName |
| Methods inherited from interface util.rmi.RmiListener |
|---|
disconnect, isConnected |
| 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 |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_HANDLERS
public static final String KEY_WEATHER
public static final String KEY_REMOTE
public static final String KEY_PICKREPLACE
private static final String DEFPICKREPLACE
private Map<String,ErrorFinalizing> handle
private CommandLaunching[] servers
private Sequencing sequencer
private ParameterClustering set
private WeatherSurveying weather
private boolean ignore
private List<TargetDefinition> current
PickConnected errors.
| Constructor Detail |
|---|
public MasterErrorHandler(Map<String,String> prop)
throws RemoteException
RemoteException| Method Detail |
|---|
public void init()
BadWeather and GoodWeather errors. Additionally
registers at all remote error casters given with the KEY_REMOTE
property. Scans the
KEY_HANDLERS key to construct and load appropriate
MasterErrorHandler.NoneErrorFinalizers for handling of incoming errors. If the
ErrorEvent.NONE has no explicit handler specified, the
MasterErrorHandler.NoneErrorFinalizer is used.
init in interface Initializableinit in class PropertyResourcespublic void setEnabled(boolean accept)
setEnabled in interface ErrorHandlingpublic void registerLauncher(CommandLaunching[] device)
KEY_REMOTE.
registerLauncher in interface ErrorHandlingpublic void registerSequencer(Sequencing seq)
registerSequencer in interface ErrorHandlingpublic void registerWeather(WeatherSurveying fake)
KEY_WEATHER key. Local weather station may be present in
case of simulated action only.
registerWeather in interface ErrorHandlingpublic void registerCluster(ParameterClustering cluster)
registerCluster in interface ClusterDependingpublic void registerMonitor(Object sleeper)
ErrorFinalizing instances. This method
should only be called after all error finalizers have been initialized.
registerMonitor in interface ErrorHandlingpublic void startTarget(TargetDefinition start)
current list. All targets stored
there may receive PickConnected errors. If such an error is
received, the most recently added targets receives it first.
startTarget in interface ErrorHandlingpublic void endTarget(TargetDefinition end)
endTarget in interface ErrorHandlingpublic boolean doAbort()
doAbort in interface ErrorHandlingpublic void exit()
exit in interface ExitCleaningexit in class AbstractRmiListener
public void rmiWeatherChanged(WeatherEvent we)
throws RemoteException
rmiWeatherChanged in interface RmiWeatherListenerRemoteExceptionpublic void weatherChanged(WeatherEvent we)
weatherChanged in interface WeatherListener
public void rmiErrorOccured(ErrorEvent ee)
throws RemoteException
errorOccured(stella.ErrorEvent) method.
rmiErrorOccured in interface RmiErrorListenerRemoteExceptionpublic void errorOccured(ErrorEvent ee)
ErrorFinalizing object is loaded and executed. If
the error has a raised pipe-flag, it is passed to the parameter cluster
registered to this error handler.To judge fast return from this event-handling methods, consider:
PickConnected. Callers can be assured that all targets have
their fields updated on method return.ParameterConnected the caller
can be assured that the parameter set has been notified.ErrorFinalizing method spark
invocation of the appropriate method. Most finalizers will run in their
own thread, so no statement can be made on their status after method
call.
errorOccured in interface ErrorListener
protected boolean registerAtCaster(RmiCaster caster,
Class service)
registerAtCaster in class AbstractRmiListener
protected boolean deregisterAtCaster(RmiCaster caster,
Class service)
deregisterAtCaster in class AbstractRmiListener
private void notifyTargets(ErrorEvent ee,
ErrorFinalizing finish,
ParameterClustering set)
PickConnected error was registered, the list of currently
active targets is traversed. Starting from the currently executing
target (the last one added with startTarget(stella.TargetDefinition)), all precursors
present in current are notified. The individual target
getting notifies receives the error on its appropriate end. An error
that occured in the currently observed target radiates to
Handable.errorMain(stella.ErrorEvent, stella.ErrorFinalizing, stella.ParameterClustering), while precursors that have the currently
queried target as successor or daughter are notified accordingly.
private void fatalError(ErrorEvent ee)
CommandLaunching.getShutdownCommand() to the peripherals.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||