public class DummySequencer extends AbstractSequencer implements ErrorCaster
start() method is called. For timing, it uses the KEY_TIME
parameter provided by the GlobalGrouping instance handed over,
thus accelerated times are handled correctly.
To check the scheduler's response on different sequencing results, one
can provide a list of error names, KEY_ERRORS that might be
generated randomly as a result of the sequencing. The probabilities may be
stated with the KEY_ERRORPROSPECTS list. Note that this list is
different from KEY_INTERRUPTS.
To check the error handler's response on different errors during the
scheduling, one might provide a KEY_INTERRUPTS list. These
errors may be produced during a normal sequence and are sent back to the
error listeners. Again, the probability of such errors to happen is
governed in the KEY_INTERRUPTPROSPECTS list. Note that
this list is different from KEY_ERRORS.
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private boolean |
cancel
The prematurely stop the sequencer.
|
private static long |
DEFDURATION
The default duration.
|
private static int |
DEFSTEP
The default duration.
|
private static String |
DEFTIME
The default time parameter.
|
private long |
duration
The estimated observation time of the target.
|
private static String |
ERRORPACKAGE
The package-path to the error events.
|
private Map |
errors
The map of the error-event results.
|
private Map |
interrupts
The map of the error interrupts.
|
static String |
KEY_DURATION
The duration to use for a target if not explicetly given.
|
static String |
KEY_ERRORPROSPECTS
The time to use from the parameters for sleeps.
|
static String |
KEY_ERRORS
The time to use from the parameters for sleeps.
|
static String |
KEY_INTERRUPTPROSPECTS
The time to use from the parameters for sleeps.
|
static String |
KEY_INTERRUPTS
The time to use from the parameters for sleeps.
|
static String |
KEY_STEP
The choping intervall for the duration to derive a sleep time.
|
static String |
KEY_TIME
The time to use from the parameters for sleeps.
|
private Thread |
mythread
The thread this sequencer runs in.
|
private static String |
NOERROR
The place holder for a null-error event.
|
private GlobalGrouping |
set
Reference to the parameters.
|
private Value |
time
The time value.
|
ALTERNATEHOST, ALTERNATEPORT, KEY_BINDNAME, 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_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
DummySequencer(Map prop)
Constructs a new dummy sequencer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(List dummy)
Abort sequence, not necessary.
|
void |
append(List dummy)
Append to sequence, not necessary.
|
void |
cancel()
Cancels the execution of the sequencer.
|
void |
forward(ReplyEvent re)
This method is called from reply deliverers.
|
private ErrorEvent |
generateErrorEvent(Map errs)
Generates an error event out of a map of available error event names.
|
Thread |
getAsociatedThread()
Always return a reference to
mythread. |
private static Map |
getErrorMap(String errorlist,
String problist)
Returns an error map linking error names to probabilities.
|
List |
getStepsForTarget(TargetDefinition aux)
Returns an empty list.
|
Thread |
getThread()
Returns the sequencer thread.
|
private long |
getTime()
Returns the time.
|
boolean |
isCancel()
Returns the cancel flag.
|
void |
load(List dummy)
Not necessary, returns immediately.
|
long |
maxTimeToCancel()
Returns 1000.
|
void |
prepend(List dummy)
Prepend to sequence, not necessary.
|
void |
registerGlobals(GlobalGrouping cluster)
Registers the parameter set.
|
void |
registerLauncher(CommandLaunching[] launch)
Register the command launchers.
|
void |
registerRender(CommandRendering dummy)
Register command renderer.
|
void |
run()
The run method of the dummy sequencer.
|
Thread |
start()
Starts the sequence.
|
ErrorEvent |
success()
Queries the result of a sequencing procedure.
|
createSequenceraddErrorListener, addRmiErrorListener, exit, init, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, 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, waitaddErrorListener, removeErrorListenerdefaultBoolean, 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_TIME
public static final String KEY_DURATION
public static final String KEY_STEP
public static final String KEY_ERRORS
public static final String KEY_ERRORPROSPECTS
public static final String KEY_INTERRUPTS
public static final String KEY_INTERRUPTPROSPECTS
private static final String DEFTIME
private static final long DEFDURATION
private static final int DEFSTEP
private static final String NOERROR
private static final String ERRORPACKAGE
private GlobalGrouping set
private Value time
private final Map errors
private final Map interrupts
private long duration
private boolean cancel
private Thread mythread
public DummySequencer(Map prop)
KEY_ERRORS or the KEY_INTERRUPTS is given,
the probabilities for the occurence of such an error is calcualted in
the following way:
KEY_ERRORPROSPECTS or KEY_INTERRUPTPROSPECTS, the
probability for a null-error event is calculated from the remaining
probability to one.public List getStepsForTarget(TargetDefinition aux)
Appointable.getStepsForTarget in interface Sequencingpublic void load(List dummy)
load in interface Sequencingpublic void abort(List dummy)
abort in interface Sequencingpublic void append(List dummy)
append in interface Sequencingpublic void prepend(List dummy)
prepend in interface Sequencingpublic void registerRender(CommandRendering dummy)
registerRender in interface Sequencingpublic void registerLauncher(CommandLaunching[] launch)
registerLauncher in interface Sequencingpublic void registerGlobals(GlobalGrouping cluster)
registerGlobals in interface GlobalDependingpublic Thread start()
getThread() method.start in interface Sequencingpublic Thread getThread()
public Thread getAsociatedThread()
mythread.getAsociatedThread in interface CancelRunnablepublic long maxTimeToCancel()
maxTimeToCancel in interface CancelRunnablepublic ErrorEvent success()
KEY_ERRORS and KEY_ERRORPROSPECTS keys, this
method returns an error event or null.public void cancel()
cancel in interface CancelRunnablepublic boolean isCancel()
isCancel in interface Sequencingpublic void forward(ReplyEvent re)
forward in interface ReplySubscriberpublic void run()
duration a sleep time for this
thread is generated by deviding the duration through KEY_STEP.
This is necessary if the time used in the parameters is an accelerated
one and we cannot sleep for the entire observation time.KEY_INTERRUPTS. We must use
the first wake-up, because this may already be the last one.success().private static final Map getErrorMap(String errorlist, String problist)
errorlist - A coma-separated list of error class names.problist - A coma-separated list of probabilites to errors above.private ErrorEvent generateErrorEvent(Map errs)
NOERROR, null is returned.private long getTime()
KEY_TIME, its value is used, otherwise the system time
is returned.