public final class TestReceiver extends CommandReceiver
processCommand(stella.CommandEvent, int) method has a probablility to
generate a time-out on the caster end.KEY_ERRORPORT on KEY_ERRORHOST. The
processError(stella.ErrorEvent) method is distorted to (additionally) open a socket
connetion, writes into the ascii-error and closes the socket again.CommandReceiver.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 int |
DEFERRORPORT
The default port to connect to the host of the ascii-error server.
|
private static double |
DEFINFOPROB
The default probability of generating an info.
|
private static double |
DEFSTATUSPROB
The default probability of generating a status.
|
private List |
errors
The error classes available for this test receiver.
|
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_ERRORHOST
The host of the ascii-error server.
|
static String |
KEY_ERRORPORT
The port to connect to the host of the ascii-error server.
|
static String |
KEY_ERRORS
A list of error classes that might be generated.
|
static String |
KEY_INFOPROB
The probability of generating an info.
|
static String |
KEY_STATUS
A list of status messages to generate.
|
static String |
KEY_STATUSPROB
The probability of generating a status.
|
private List |
stati
The status classes available for this test receiver.
|
KEY_AVAILABLE, KEY_COMMANDGROUP, KEY_TIMEOUTKEY_BIND, KEY_BINDNAMEDEFSERVERPORT, handlerGroup, KEY_BUFFERSIZE, KEY_HANDLERPRIORITY, KEY_HOSTADDRESS, KEY_LOGOUT, KEY_RECEIVERNAME, KEY_SERVERPORT, KEY_SERVERPRIORITYALTERNATEHOST, ALTERNATEPORT, KEY_EXPORTPORT, KEY_REGISTRYHOST, KEY_REGISTRYPORTKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORKEY_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 |
|---|---|
private ErrorEvent |
createErrorEventFromList(List classes)
Takes a list of error event classes and creates a living object out of
it.
|
protected int |
getAcknowledgeNumber(CommandEvent cmd)
Returns the type of the first acknowledge event.
|
protected long |
getCompletionTime(CommandEvent ignore,
int dummytype)
Returns a time between
KEY_ACKMIN and KEY_ACKMAX. |
protected ErrorEvent |
getLastError()
Returns a randomly selected error out of the errorlist.
|
static void |
main(String[] arg)
For testing.
|
protected boolean |
processCommand(CommandEvent ignore,
int dummytype)
Processes the given command.
|
void |
processError(ErrorEvent ee)
Processes the error in a way that it send it as an ascii string to the
specified post,
KEY_ERRORPORT, on the specified host,
KEY_ERRORHOST. |
cancel, protocol, sendInfo, sendStatusexit, initgetAsociatedThread, getBufferSize, getHandlerPriority, getReceiverName, getServerPort, getServerPriority, initReceiverServer, maxTimeToCancel, runaddErrorListener, addRmiErrorListener, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatusbindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, getBindName, getBindName, unbindFromRegistry, unbindFromRegistrycontainsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemotePropertyclone, 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, waitaddRmiErrorListener, removeRmiErrorListenerbindToRegistry, isValid, unbindFromRegistrydefaultBoolean, 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_ERRORHOST
public static final String KEY_ERRORPORT
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
public static final String KEY_STATUS
public static final String KEY_INFOPROB
private static final int DEFERRORPORT
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 static final double DEFINFOPROB
private List errors
private List stati
public TestReceiver(Map ensure) throws RemoteException
RemoteExceptionpublic void processError(ErrorEvent ee)
KEY_ERRORPORT, on the specified host,
KEY_ERRORHOST. The socket connection is terminated after the
error has been sent. Additionally, the super class's method is called
for additional notification of RMI error listeners.processError in interface ErrorProcessingprocessError in class ErrorServeree - The ErrorEvent to pass to the Listeners.protected int getAcknowledgeNumber(CommandEvent cmd)
getAcknowledgeNumber in class CommandReceiverprotected long getCompletionTime(CommandEvent ignore, int dummytype)
KEY_ACKMIN and KEY_ACKMAX.getCompletionTime in class CommandReceiverignore - The command to process.dummytype - The type 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 CommandReceiverprotected ErrorEvent getLastError()
getLastError in class CommandReceiverprivate ErrorEvent createErrorEventFromList(List classes)
public static void main(String[] arg) throws RemoteException
RemoteException