stella.rmi
Class TestCaster
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
stella.rmi.AbstractRmiCasterAndListener
stella.rmi.CasterTorso
stella.rmi.TestCaster
- All Implemented Interfaces:
- Cloneable, Remote, EventListener, Caster, CommandLaunching, ErrorSending, ErrorCaster, ReplyDeliverer, RmiAcknowledgeListener, RmiCommandCaster, RmiDoneListener, RmiErrorCaster, AlarmHandler, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiEventListener, RmiListener, RmiPropertyBearing
public class TestCaster
- extends CasterTorso
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()
Constructs a test caster. |
| Methods inherited from class stella.rmi.CasterTorso |
addRmiCommandListener, announceInterest, castCommand, deregisterAtCaster, exit, getAcknowledgeTimeOut, getAlarmGroup, getClientName, getExitCommand, init, recastCommand, registerAtCaster, registerReplySubscriber, removeRmiCommandListener, rmiGotAcknowledge, rmiGotDone, setOff, toString |
| 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, rescanned, startBinding, startBinding |
| 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, setObject, setProperties, setProperty, stringProperties |
| 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 |
testInstrument
private RmiCommandListener testInstrument
TestCaster
public TestCaster()
throws RemoteException
- Constructs a test caster. Relies on default values for everything.
- Throws:
RemoteException
setCommandListener
public void setCommandListener(RmiCommandListener ear)
- Registers the only test command listener.
notifyCommandListener
protected void notifyCommandListener(CommandEvent ce)
- Notifies the test receiver. Note that the test caster does not implement
any explicit caster capabilities. The only purpose is to send
to a test receiver.
handles
public boolean handles(CommandEvent ce)
- Description copied from interface:
CommandLaunching
- Returns true if the caster can handles this command event.
isReady
public boolean isReady()
- Description copied from class:
CasterTorso
- Checks if all connections to registered listeners are intact. If no
listeners are registered this method returns true.
Simply calls the RmiListener.isConnected() method, which
should return true or throw a remote exception.
- Specified by:
isReady in interface CommandLaunching- Overrides:
isReady in class CasterTorso
getShutdownCommand
public CommandEvent getShutdownCommand()
- Returns the shut-down command for the test caster. This is null.
main
public static void main(String[] arg)
throws RemoteException
- For testing. First command line argument is the name of the receiver.
If the receiver was successfully register test commands,
derived from the second command line argument, are sent to it.
Between individual command this thread sleeps for an arbitrary period
of up to 10 sec.
- Throws:
RemoteException