public class MasterLauncher extends AbstractCommandLauncher implements ErrorCaster, RmiErrorCaster, RmiCommandCaster, Initializable, ExitCleaning
CommandLaunching instance for master commands. Master commands
are internally handled commands that may appear in a sequence definition.
To allow the sequencer to cast this command as remote command to remote
CommandLaunching instances, this class acts as the 'missing link'.
Note that this class is highly specific in the sense that internal
commands will in most cases not be recognizable on different systems.
This class also acts as a ReplyDeliverer though it is not
an acknowledge or done caster. Reply events are only generated if they
match
To allow the SCS to cast errors similar to other CommandLaunching
instances, this class extends the CastingContainer class.
Additionally, RmiCommandCaster may be enabled. The
rmi-casting capabilities are intended for remote logging only.
| Modifier and Type | Class and Description |
|---|---|
protected class |
MasterLauncher.MasterHelper
The master launcher helper thread.
|
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private MasterMind |
chef
The master mind.
|
private List |
command
The list of rmi-command listeners.
|
private static double |
DEFACCELERATE
The default acceleration factor.
|
private static boolean |
DEFBIND
The default error-binding behaviour.
|
private static String |
DEFNAME
The default name of the master launcher (SCS).
|
private static long |
DEFSHUTDOWNDELAY
The default shutdown delay time, 5 sec.
|
private static String |
DEFSTARTGRAB
The default start-grab script.
|
private static String |
DEFSTOPGRAB
The default start-grab script.
|
private ReplySubscriber |
forward
The registered reply subscriber.
|
static String |
KEY_ACCELERATE
The key matching possible acceleration of the internal counter.
|
static String |
KEY_BIND
The key matching the default error casting binding.
|
static String |
KEY_BINDNAME
The key linked to the server name.
|
static String |
KEY_NAME
The key linked to the client's name.
|
static String |
KEY_SHUTDOWNDELAY
The time delay from receiving quit-command until orderly shutdown.
|
static String |
KEY_STARTGRAB
The key to the command line for starting the grabbing.
|
static String |
KEY_STOPGRAB
The key to the command line for starting the grabbing.
|
private List |
pattern
The replies the reply subscriber is interested in.
|
private AlarmWatch |
stopwatch
An alarm to act as an interruptable stop-watch.
|
ALTERNATEHOST, 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_MAPSEPARATORNAMING_EXTENSIONCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
MasterLauncher(Map prop)
Constructs a new master launcher with the specified properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRmiCommandListener(RmiCommandListener ear)
Registers a command listener to the master launcher.
|
void |
announceInterest(ReplyEvent re)
Adds a new reply event pattern to the pattern list.
|
void |
castCommand(CommandEvent ce)
Cast the command to the SCS.
|
void |
cont()
For times the guiding was lost.
|
void |
exit()
Unbind thyself from the rwgistry.
|
String |
getBindName()
Returns the name of the master launcher used for readability
improvement.
|
String |
getClientName()
Returns the name of the master launcher used for readability
improvement.
|
CommandEvent |
getExitCommand()
Default implementation of exit command is null.
|
CommandEvent |
getShutdownCommand()
Returns the shutdown command.
|
void |
halt()
For times the guiding was lost.
|
boolean |
handles(CommandEvent ce)
The master launcher handles
ScsCommands. |
void |
init()
Initializes the master launcher.
|
boolean |
isReady()
This is an internal command launcher.
|
protected void |
processCommand(CommandEvent ce)
The method to handle internal (master) commands.
|
void |
recastCommand()
Empty method.
|
protected void |
registerMasterMind(MasterMind sub)
Registers the reply subscriber.
|
void |
registerReplySubscriber(ReplySubscriber sub)
Registers the reply subscriber.
|
void |
removeRmiCommandListener(RmiCommandListener ear)
Deregisters a command listener to the master launcher.
|
createCommandLauncheraddErrorListener, addRmiErrorListener, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatusbindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, 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, removeErrorListeneraddRmiErrorListener, 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_NAME
public static final String KEY_BINDNAME
public static final String KEY_BIND
public static final String KEY_ACCELERATE
public static final String KEY_STARTGRAB
public static final String KEY_STOPGRAB
public static final String KEY_SHUTDOWNDELAY
private static final String DEFNAME
private static final boolean DEFBIND
private static final double DEFACCELERATE
private static final String DEFSTARTGRAB
private static final String DEFSTOPGRAB
private static final long DEFSHUTDOWNDELAY
private ReplySubscriber forward
private final List pattern
private final AlarmWatch stopwatch
private final List command
private MasterMind chef
public MasterLauncher(Map prop) throws RemoteException
DEFNAME.
Binding the rmi error-caster to the registry is defined with the
KEY_BIND property. The default setting is
DEFBIND. The binding name used is defined with
KEY_BINDNAME, defaults to DEFNAME.RemoteExceptionpublic void init()
init in interface Initializableinit in class CastingContainerpublic void exit()
exit in interface ExitCleaningexit in class CastingContainerpublic CommandEvent getExitCommand()
getExitCommand in interface CommandLaunchingpublic void registerReplySubscriber(ReplySubscriber sub)
registerReplySubscriber in interface ReplyDeliverersub - The reply subscriber interested in received replies.protected void registerMasterMind(MasterMind sub)
sub - The reply subscriber interested in received replies.public void announceInterest(ReplyEvent re)
castCommand(stella.CommandEvent)). Note that handling of multiple acknowledge
commands is not possible in a master launcher.announceInterest in interface ReplyDelivererpublic String getClientName()
getClientName in interface CommandLaunchingpublic String getBindName()
getBindName in class AbstractRmiCasterpublic CommandEvent getShutdownCommand()
ParkMaster
command.getShutdownCommand in interface CommandLaunchingpublic boolean isReady()
isReady in interface CommandLaunchingpublic boolean handles(CommandEvent ce)
ScsCommands.handles in interface CommandLaunchingpublic void castCommand(CommandEvent ce)
processCommand(stella.CommandEvent) method. Additionally, it checks for
registered acknloedge events prior to the call to this method and for
registered done events after this method returns.castCommand in interface CommandLaunchingpublic void addRmiCommandListener(RmiCommandListener ear) throws RemoteException
addRmiCommandListener in interface RmiCommandCasterRemoteExceptionpublic void removeRmiCommandListener(RmiCommandListener ear) throws RemoteException
removeRmiCommandListener in interface RmiCommandCasterRemoteExceptionpublic void recastCommand()
recastCommand in interface CommandLaunchingpublic void halt()
cont() method is called.public void cont()
halt() method has been called.protected void processCommand(CommandEvent ce)
ReceiverTorso class).