|
||||||||||
| 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.rmi.AbstractRmiCasterAndListener
stella.rmi.ReceiverTorso
stella.jview.DeviceSimulator
public final class DeviceSimulator
The receiver end to a caster. This method is a generic device tester. It acts as a remote device. The user can choose between different acknoledge and done messages generated and sent back to the caster. Various error messages can be produced at any time.
A screenshot of an active device simulator looks like this:
RmiAcknowledgeCaster,
RmiDoneCaster, and RmiErrorCaster abilities to the registry,
the appropriate bind fields get true. If the receiver is listening
to a command caster the Command listening field gets true.JPlusMinusBox or by
directly entering the acknowledge number in the appropriate field. Note
that only the initial acknowledge message will be sent back automatically,
after a delay time specified in the delay for 1st ack. field.
The completion time this initial acknowledge message carries is specified in
the next line. Any further acknowledge messages are only sent if the user
presses the ACK button. It carries the completion time specified
in the field right to the ACK button.JExitButton. Commands are imprinted in brown
while acknowledge messages show up in green, done messages are blue. Errors
generated show up in red. Any other status information is printed in
black.
| Nested Class Summary | |
|---|---|
protected class |
DeviceSimulator.SimulationHandler
A thread that takes over the handling of the incomming command in the device simulator. |
| Nested classes/interfaces inherited from class stella.rmi.ReceiverTorso |
|---|
ReceiverTorso.CommandHandler |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
static String[] |
ACCEPTS
The keywords understood by the accept-key. |
private JTextField |
ackcomplete
The completion time for the interactively sent acknowledge event. |
private JButton |
acknowledge
Button for interactively sending back an acknowledge event. |
private JIncrementField |
acknr
Input field for number of acknowledges. |
private JLabel |
bindack
Boolean labels describing the status of device binding. |
private JLabel |
binddone
Boolean labels describing the status of device binding. |
private JLabel |
binderror
Boolean labels describing the status of device binding. |
private JTextField |
complete
Input field for completion time of first acknowledge. |
private static String |
DEFACCEPT
The default accept key. |
private static int |
DEFCOMPLETE
The default completion time of the acknowledge event. |
private static int |
DEFDELAY
The default delay between command receipt and acknowledge. |
private JTextField |
delay
Input field for delay between command and first acknowledge. |
private JButton |
done
Button for interactive sending of done event. |
private JButton |
error
Button to send back an error message. |
private JComboBox |
errorlist
A list of instantiable error events. |
static String |
KEY_ACCEPT
The key to the commands accepted. |
static String |
KEY_COMPLETE
The key to the completion time of the first acknowledge event. |
static String |
KEY_DELAY
The key to the default delay between command receipt and acknowledge. |
static String |
KEY_ERROR
The key to the comma-separated list of instantiable errors. |
static String |
KEY_NAME
The key to the device name. |
private JLabel |
listen
Boolean labels describing the status of device binding. |
private JRadioButton |
no
The completion flag of the done event sent back. |
private DeviceSimulator.SimulationHandler |
receive
The receiver thread. |
private JStatusExit |
status
The status panel to display commands, erros, and replies. |
private JRadioButton |
yes
The completion flag of the done event sent back. |
| Fields inherited from class stella.rmi.ReceiverTorso |
|---|
KEY_BIND, KEY_BINDNAME, KEY_COMMANDCASTER, KEY_ERRORCOOL |
| 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 stella.rmi.RmiAcknowledgeCaster |
|---|
NAMING_EXTENSION |
| Fields inherited from interface stella.rmi.RmiDoneCaster |
|---|
NAMING_EXTENSION |
| Fields inherited from interface util.StepInitializable |
|---|
KEY_INITDEPTH |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
DeviceSimulator(Map prop)
Constructs a new test receiver. |
|
| Method Summary | |
|---|---|
boolean |
accepts(CommandEvent ce)
A device simulator can accept all types of commands. |
protected boolean |
deregisterAtCaster(RmiCaster caster,
Class service)
Links into the parent's ReceiverTorso.registerAtCaster(util.rmi.RmiCaster, java.lang.Class>) method. |
private Component |
doLayout()
Returns the panel after all components have been constructed. |
void |
exit()
Does necessary clearing jobs. |
protected int |
getAcknowledgeNumber(CommandEvent cmd)
Returns the type of the first acknowledge event. |
protected long |
getCompletionTime(CommandEvent ignore,
int dummytype)
Return the value of the completion-time text-field, multiplied with 1000. |
Icon |
getIcon()
The default implementation returns null here. |
protected ErrorEvent |
getLastError()
Retunrns null. |
Component |
getRepresentation()
Creates all components of this device simulator, groups them into a panel which is then returned. |
private void |
init5()
Manually initiates the rmi-caster and listener bindings. |
void |
initStep(int curstep)
Manually initiates the rmi-caster and listener bindings. |
static void |
main(String[] arg)
For testing. |
protected boolean |
processCommand(CommandEvent ignore,
int dummytype)
Processes the given command. |
protected boolean |
registerAtCaster(RmiCaster caster,
Class service)
Links into the parent's ReceiverTorso.registerAtCaster(util.rmi.RmiCaster, java.lang.Class>) method. |
void |
rmiCommand(CommandEvent cmd)
The command receiving method. |
| Methods inherited from class stella.rmi.AbstractRmiCasterAndListener |
|---|
addErrorListener, addRmiErrorListener, bindToRegistry, getBindName, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatus, unbindFromRegistry |
| Methods inherited from class util.rmi.AbstractRmiListener |
|---|
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, startBinding, startBinding |
| 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, init, 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 |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.rmi.RmiCaster |
|---|
bindToRegistry, isValid, unbindFromRegistry |
| Methods inherited from interface stella.ErrorCaster |
|---|
addErrorListener, removeErrorListener |
| Methods inherited from interface util.rmi.RmiEventListener |
|---|
getListenerName |
| Methods inherited from interface util.rmi.RmiListener |
|---|
disconnect, isConnected |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| 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.Initializable |
|---|
init |
| Field Detail |
|---|
public static final String KEY_DELAY
public static final String KEY_COMPLETE
public static final String KEY_ERROR
public static final String KEY_NAME
public static final String KEY_ACCEPT
public static final String[] ACCEPTS
private static final String DEFACCEPT
private static final int DEFDELAY
private static final int DEFCOMPLETE
private JIncrementField acknr
private JTextField delay
private JTextField complete
private JButton done
private JRadioButton yes
private JRadioButton no
private JButton acknowledge
private JTextField ackcomplete
private JButton error
private JComboBox errorlist
private JLabel bindack
private JLabel binddone
private JLabel binderror
private JLabel listen
private JStatusExit status
private DeviceSimulator.SimulationHandler receive
| Constructor Detail |
|---|
public DeviceSimulator(Map prop)
throws RemoteException
RemoteException| Method Detail |
|---|
public void initStep(int curstep)
initStep in interface StepInitializableinitStep in class ReceiverTorsocurstep - The current initialization depth.private void init5()
public Icon getIcon()
getIcon in interface Displayablepublic Component getRepresentation()
getRepresentation in interface Displayableprivate Component doLayout()
public void exit()
exit in interface ExitCleaningexit in class ReceiverTorso
public void rmiCommand(CommandEvent cmd)
throws RemoteException
rmiCommand in interface RmiCommandListenerrmiCommand in class ReceiverTorsocmd - The command to process.
RemoteException
public boolean accepts(CommandEvent ce)
throws RemoteException
KEY_ACCEPT key pointing to one of the ACCEPTS
codes. Each of them has its obvious meaning.
accepts in interface RmiCommandListenerRemoteException
protected boolean registerAtCaster(RmiCaster caster,
Class service)
ReceiverTorso.registerAtCaster(util.rmi.RmiCaster, java.lang.Class>) method.
If it returns true the listen label is set to true.
registerAtCaster in class ReceiverTorso
protected boolean deregisterAtCaster(RmiCaster caster,
Class service)
ReceiverTorso.registerAtCaster(util.rmi.RmiCaster, java.lang.Class>) method.
If it returns true the listen label is set to true.
deregisterAtCaster in class ReceiverTorsoprotected ErrorEvent getLastError()
getLastError in class ReceiverTorsoprotected int getAcknowledgeNumber(CommandEvent cmd)
getAcknowledgeNumber in class ReceiverTorso
protected long getCompletionTime(CommandEvent ignore,
int dummytype)
getCompletionTime in class ReceiverTorsoignore - The command to process.dummytype - The number of the acknowledge that will be sent back.
protected boolean processCommand(CommandEvent ignore,
int dummytype)
processCommand in class ReceiverTorso
public static void main(String[] arg)
throws RemoteException
RemoteException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||