stella.net
Class TestCaster
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiCaster
stella.CastingContainer
stella.AbstractCommandLauncher
stella.net.CasterClient
stella.net.TestCaster
- All Implemented Interfaces:
- Cloneable, Remote, Caster, CommandLaunching, ErrorCaster, ReplyDeliverer, RmiAcknowledgeCaster, RmiCommandCaster, RmiDoneCaster, RmiErrorCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing
public class TestCaster
- extends CasterClient
This class test some capabilities of the caster class. It sends to a test
receiver class test commands with command numbers 799.
The replies received from the test receiver are piped to standard err.
|
Constructor Summary |
TestCaster(Map ensure)
Constructs a test caster. |
| Methods inherited from class stella.net.CasterClient |
addRmiAcknowledgeListener, addRmiCommandListener, addRmiDoneListener, announceInterest, castCommand, checkForward, close, exit, getAcknowledgeTimeOut, getAlarmGroup, getBufferSize, getClientName, getExitCommand, getPort, getReceiver, init, notifyAcknowledgeListener, notifyCommandListener, notifyDoneListener, recastCommand, registerReplySubscriber, removeRmiAcknowledgeListener, removeRmiCommandListener, removeRmiDoneListener |
| Methods inherited from class stella.CastingContainer |
addErrorListener, addRmiErrorListener, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatus |
| 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, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| 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 |
TestCaster
public TestCaster(Map ensure)
throws RemoteException
- Constructs a test caster. Relies on default values for everything.
- Throws:
RemoteException
handles
public boolean handles(CommandEvent ce)
- A test caster handles test commands.
- Specified by:
handles in interface CommandLaunching- Overrides:
handles in class CasterClient
isReady
public boolean isReady()
- Description copied from class:
CasterClient
- Should always return true if socket connection is open.
- Specified by:
isReady in interface CommandLaunching- Overrides:
isReady in class CasterClient
getShutdownCommand
public CommandEvent getShutdownCommand()
- Description copied from interface:
CommandLaunching
- Returns the command that initiates a shutdown on the device or prepares
it for a shutdown.
generateRandomCommand
private static final CommandEvent generateRandomCommand(Object src)
- Generates one random command out of a list of possible command. This
part is hard-coded but only meant for testing.
main
public static void main(String[] arg)
throws RemoteException,
IOException
- For testing. First command line argument is the name of the receiver.
If the receiver was successfully register test commands are sent to it.
Between individual command this thread sleeps for an arbitrary period
of up to 10 sec.
- Throws:
RemoteException
IOException