public final class TestReceiver extends GenericMaster
processCommand(stella.CommandEvent, int) method has a 0.1 probablility to
generate a time-out on the caster end.GenericMaster.StandaloneReceiverTorso.CommandHandlerPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static long |
DEFACKMAX
The default maximum acknowledge time.
|
private static long |
DEFACKMIN
The default minimum acknowledge time.
|
private static double |
DEFCOMMANDFAIL
The default probability of command execution failure.
|
private static double |
DEFCOMMANDLONG
The default probability of command execution time-out.
|
private static double |
DEFSTATUSPROB
The default probability of generating a status.
|
private List |
errors
The error classes available for this test receiver.
|
private Class |
handles
The class type of commands accepted.
|
static String |
KEY_ACCEPTS
The interface name of accepted commands.
|
static String |
KEY_ACKMAX
The maximum acknowledge time sent back.
|
static String |
KEY_ACKMIN
The minimum acknowledge time sent back.
|
static String |
KEY_COMMANDFAIL
The probability of command execution failure.
|
static String |
KEY_COMMANDLONG
The probability of command execution time-out.
|
static String |
KEY_ERRORS
A list of error classes that might be generated.
|
static String |
KEY_STATUSPROB
The probability of generating a status.
|
DEFUNIQUE, KEY_ABORTTIME, KEY_AUTOMATIC, KEY_COMMTIME, KEY_COMMUNICATOR, KEY_DRIVERS, KEY_HISTORYDB, KEY_INITTIME, KEY_NODB, KEY_OBSERVEDB, KEY_OVERRULEAUTO, KEY_PARKTIME, KEY_PERMISSIONDB, KEY_PROPOSALDB, KEY_QUITTIME, KEY_REAUTO, KEY_RESETTIME, KEY_SET, KEY_SHUTDOWNDELAY, KEY_STATUSTIME, KEY_TARGETDB, KEY_TASKDB, KEY_UNIQUE, KEY_USERDB, lastabort, lastinit, lastpark, lastreset, telescopeKEY_BIND, KEY_BINDNAME, KEY_COMMANDCASTER, KEY_ERRORCOOLKEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEPKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORNAMING_EXTENSIONNAMING_EXTENSIONKEY_INITDEPTHKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOMECONFIG, KEY_CLASS| Constructor and Description |
|---|
TestReceiver(Map ensure)
Constructs a new test receiver.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(CommandEvent ce)
A tester accepts the commands that are defined with the
KEY_ACCEPTS command. |
protected int |
getAcknowledgeNumber(CommandEvent cmd)
Returns the number of acknowledge messages that will be generated
for this command.
|
protected long |
getCompletionTime(CommandEvent ignore,
int dummytype)
Returns a time between
KEY_ACKMIN and KEY_ACKMAX. |
protected ErrorEvent |
getLastError(CommandEvent dummy)
Returns a randomly selected error out of the errorlist.
|
protected boolean |
initializeMaster(CommandEvent dummy)
Method called to init the device.
|
static void |
main(String[] arg)
For testing.
|
protected boolean |
parkMaster(CommandEvent dummy)
Method called to park the device.
|
protected boolean |
processCommand(CommandEvent ignore,
int dummytype)
Processes the given command.
|
protected boolean |
resetMaster(CommandEvent dummy)
Method called to reset the device.
|
protected Object |
statusMaster(CommandEvent dummy)
Method called to return the status string.
|
abortMaster, addErrorListener, addRmiErrorListener, automatic, createCommunicator, createCommunicator, exit, external, formatWithGlobals, getAllDrivers, getDriver, getHistorySql, getObserveSql, getOffsetCaster, getParameterByKey, getParameterByName, getParameterCluster, getParameterValueByKey, getParameterValueByName, getPermissionSql, getProposalSql, getStatus, getTargetSql, getTaskSql, getUnique, getUniqueId, getUserSql, initialize, initStep, isAlive, isAuto, isManual, isPassive, manual, park, quit, quitMaster, reload, rescanned, reset, resetAlarm, resetAllDrivers, restartAllDrivers, revert, rmiAddParameter, rmiCommand, rmiGet, rmiGetAllParameterNames, rmiRemoveParameter, rmiSet, setLastError, setOff, setParameterValueByKey, setParameterValueByName, setPassive, shutdown, zeroAllOmcaddRmiAcknowledgeListener, addRmiDoneListener, bindDefault, containsRemoteProperty, deregisterAtCaster, equals, getRemoteProperties, getRemoteProperty, hashCode, notifyAcknowledgeListener, notifyDoneListener, registerAtCaster, removeRmiAcknowledgeListener, removeRmiDoneListener, sendAllPrematureDone, sendPrematureDone, setRemoteProperty, toString, unbindDefaultbindToRegistry, getBindName, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatus, unbindFromRegistryallBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, startBinding, startBindingclone, 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, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesfinalize, getClass, notify, notifyAll, wait, wait, waitbindToRegistry, isValid, unbindFromRegistryremoveErrorListenergetListenerNamedisconnect, isConnecteddefaultBoolean, 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_ACCEPTS
public static final String KEY_ERRORS
public static final String KEY_ACKMIN
public static final String KEY_ACKMAX
public static final String KEY_COMMANDFAIL
public static final String KEY_COMMANDLONG
public static final String KEY_STATUSPROB
private static final long DEFACKMIN
private static final long DEFACKMAX
private static final double DEFCOMMANDFAIL
private static final double DEFCOMMANDLONG
private static final double DEFSTATUSPROB
private Class handles
private List errors
public TestReceiver(Map ensure) throws RemoteException
RemoteExceptionpublic boolean accepts(CommandEvent ce) throws RemoteException
KEY_ACCEPTS command. If the command handed over is an
instance of the class (interface) represented by the class
named with the KEY_ACCEPTS key, it will return true. If the
key is missing, true will be returned.RemoteExceptionprotected int getAcknowledgeNumber(CommandEvent cmd)
getAcknowledgeNumber in class GenericMasterprotected long getCompletionTime(CommandEvent ignore, int dummytype)
KEY_ACKMIN and KEY_ACKMAX.getCompletionTime in class GenericMasterignore - The command to process.dummytype - The number of the acknowledge that will be sent back.protected boolean processCommand(CommandEvent ignore, int dummytype)
KEY_COMMANDLONG
probability, the execution of this command may take longer than the
acknowledge time sent back. Note that KEY_COMMANDLONG
probability is a maximum failure probability because the acknowledge
time sent back may vary between KEY_ACKMIN and
KEY_ACKMAX, while the KEY_COMMANDLONG probability
is the probability that the execution of the command will take longert
than KEY_ACKMIN. With a probability of KEY_COMMANDFAIL
the command execution will fail, resulting in
an error to be generated and sent back, see KEY_ERRORS.
A simple status message is sent with a probability of
KEY_STATUSPROB.processCommand in class GenericMasterprotected ErrorEvent getLastError(CommandEvent dummy)
getLastError in class ReceiverTorsoprotected boolean resetMaster(CommandEvent dummy)
resetMaster in class GenericMasterdummy - Non-null in automatic mode.protected boolean initializeMaster(CommandEvent dummy)
initializeMaster in class GenericMasterdummy - Non-null in automatic mode.protected boolean parkMaster(CommandEvent dummy)
parkMaster in class GenericMasterdummy - Non-null in automatic mode.protected Object statusMaster(CommandEvent dummy)
statusMaster in class GenericMasterdummy - Non-null in automatic mode.ErrorEvent.public static void main(String[] arg) throws RemoteException
RemoteException