|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractCachedParameter
stella.parameter.AbstractStatusRequestor
stella.parameter.TelescopeError
public class TelescopeError
A class that uses incoming TelescopeStatus errors to deduce
eventually occuring telescope errors. This is done by scanning the
TelescopeStatus.getErrors() return as a comma-separated list of
PILAR-specific errors. Each error encountered is matched to an internal
lookup-table of PILAR error-names to SCS error-classes in
KEY_TABLELIST or KEY_TABLEFILE.
If a match is found, an appropriate error class is instantiated and passed
to registered error-listeners (a error-handler presumably).
As this parameter is of a polling-type, the cache-time of the parent class is used as the polling-time. The value of the parameter are the list of currently active errors.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static String |
DEFCOMMAND
The default class name of the status command to send. |
static String |
DEFNAME
The default name of this parameter. |
private static long |
DEFPOLLTIME
The default poll time. |
private static String |
DEFTABLELIST
The home position of the telescope. |
private static long |
DEFWAIT
The default wait time. |
private List<ErrorListener> |
ear
The list of registered error listeners. |
static String |
KEY_POLLTIME
The polling time. |
static String |
KEY_TABLEFILE
The table of PILAR error-names to SCS error-classes. |
static String |
KEY_TABLELIST
The table of PILAR error-names to SCS error-classes. |
static String |
KEY_WAIT
The initial wait time. |
private Map<String,ErrorEvent> |
pilar
The look-up table matching PILAR names to true error objects. |
private Timer |
request
The timer used for issuing status requests. |
| Fields inherited from class stella.parameter.AbstractStatusRequestor |
|---|
KEY_COMMAND, KEY_DISABLE, KEY_TIMEOUT |
| Fields inherited from class stella.parameter.AbstractCachedParameter |
|---|
KEY_CACHE |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| 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 stella.ErrorDependingParameter |
|---|
NAMING_EXTENSION |
| 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 | |
|---|---|
TelescopeError(Map<String,String> prop)
Constructs a new telescope-error parameter. |
|
| Method Summary | |
|---|---|
void |
addErrorListener(ErrorListener handler)
Registers an error event listener to this property container. |
private void |
check()
Checks if the currently valid errors stored in the cache are recognized and should spark a error-handler notification. |
private Map<String,ErrorEvent> |
constructTable()
|
void |
exit()
Exits this parameter. |
Object |
getForError(ErrorEvent ee)
Returns the pilar-errors of the telescope deduced from a freshly received TelescopeStatus. |
void |
init()
Initializes the telescope error parameter. |
protected boolean |
isStatusRequested(ErrorEvent ee)
Returns true if the error event received is of TelescopeStatus |
protected void |
notifyErrorListeners(ErrorEvent ee)
Notifies all registered ErrorListeners. |
boolean |
registerLauncher(CommandLaunching launch)
Registers the appropriate command caster that can handle the appropriate request. |
void |
removeErrorListener(ErrorListener handler)
Deregisters an error event listener from this property container. |
double |
rescanned(String key,
String old,
String newval)
Returns zero if the polltime or wait period changed, reload the error lookup table if the tablelist or file changed. |
| Methods inherited from class stella.parameter.AbstractStatusRequestor |
|---|
getUncached, registerError |
| Methods inherited from class stella.parameter.AbstractCachedParameter |
|---|
get, getCache, getCacheFormatted, set |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.Reloadable |
|---|
reload |
| Methods inherited from interface stella.StatusRequesting |
|---|
getCache, getCacheFormatted |
| Methods inherited from interface stella.Parameter |
|---|
get, getFormatted, getName, getString, set |
| 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_WAIT
public static final String KEY_POLLTIME
public static final String KEY_TABLELIST
public static final String KEY_TABLEFILE
public static final String DEFNAME
private static final long DEFWAIT
private static final long DEFPOLLTIME
private static final String DEFTABLELIST
private static final String DEFCOMMAND
private Map<String,ErrorEvent> pilar
private List<ErrorListener> ear
private Timer request
| Constructor Detail |
|---|
public TelescopeError(Map<String,String> prop)
| Method Detail |
|---|
public void init()
KEY_TABLEFILE property to load
a properties file, or, if this key is missing, the
KEY_TABLELIST is used to convert the mapped string to
a properties object with the StringTool.propertize(java.lang.String) mthod.
init in interface Initializableinit in class AbstractStatusRequestor
public double rescanned(String key,
String old,
String newval)
rescanned in interface Reloadablerescanned in class AbstractStatusRequestorprivate Map<String,ErrorEvent> constructTable()
public boolean registerLauncher(CommandLaunching launch)
registerLauncher in interface StatusRequestingregisterLauncher in class AbstractStatusRequestorpublic Object getForError(ErrorEvent ee)
TelescopeStatus. This method should be followed by a
check() call which actually performs the test for errors.
getForError in interface ErrorDependingParameterpublic void exit()
exit in interface ExitCleaningexit in class AbstractParameterpublic void addErrorListener(ErrorListener handler)
addErrorListener in interface ErrorCasterpublic void removeErrorListener(ErrorListener handler)
removeErrorListener in interface ErrorCasterprotected void notifyErrorListeners(ErrorEvent ee)
ee - The ErrorEvent to pass to the Listeners.protected boolean isStatusRequested(ErrorEvent ee)
TelescopeStatus
isStatusRequested in class AbstractStatusRequestorprivate void check()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||