stella.roof
Class BuildingAccess
java.lang.Object
util.CommandLineParser
stella.rmi.GenericAccess
stella.roof.BuildingAccess
public class BuildingAccess
- extends GenericAccess
A small program allowing access to BuildingControlling and
RemoteLight enhanced objects.
The command line arguments are scanned for recognized switches and
processed accordingly. Additionally to the functionality of the parent
class ShiftListener, this class supports the following switches:
- -o: Opens the roof, regardless of its current state.
Intended for emergency situations only.
- -c: Closes the roof, regardless of its current state.
Intended for emergency situations only.
- Both, -o and -c: enhanced with appended
-l or -r: Act only on right or left roof.
- -a: Enables automatic roof control. If the roof is actually
controlled by a non-automatic command caster, e.g. a
JLaunchBox, this caster should be deregistered
before enabling automatic mode.
- -m: Disables automatic roof control, i.e. shifts to
a manual mode. Control with a non-automatic command caster, e.g. a
JLaunchBox, requires additionally a registering at
the new caster.
- -q: Quits the building controling instance.
|
Field Summary |
static String |
ONESWITCH
The command line switche with an argument. |
static String |
SWITCHES
The command line switches understood by this access class. |
|
Constructor Summary |
BuildingAccess()
Constructs a new building access instance. |
|
Method Summary |
static void |
main(String[] arg)
Access to a building-control object. |
protected boolean |
processSwitches(Remote listener)
Process the command line switches found. |
| Methods inherited from class util.CommandLineParser |
getArguments, getCommandLine, getCommands, getRegisteredSwitches, hasAnySwitch, hasSwitch, hasSwitch, haveAllSwitches, parse, printCommandLine, registerLine, registerSwitches, setCommands, staticUsage, usage |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SWITCHES
public static final String SWITCHES
- The command line switches understood by this access class.
- See Also:
- Constant Field Values
ONESWITCH
public static final String ONESWITCH
- The command line switche with an argument.
- See Also:
- Constant Field Values
BuildingAccess
public BuildingAccess()
- Constructs a new building access instance. The switches understood are
readily added to the command line parser.
processSwitches
protected boolean processSwitches(Remote listener)
throws RemoteException
- Process the command line switches found. If the remote reference handed
over is a
BuildingControlling and one of the switches
defined in
SWITCHES is given, the appropriate method of the listener
control is called. Note that the command line must be parsed before
calling this method.
Implementation note: Prior to the new command line switches, the one
provided by the parent class are processed.
- Overrides:
processSwitches in class GenericAccess
- Returns:
- True on success.
- Throws:
RemoteException
main
public static void main(String[] arg)
throws ParseException,
RemoteException,
NotBoundException,
MalformedURLException
- Access to a building-control object. Command line switches may be
grouped arbitrarily.
- Throws:
ParseException
RemoteException
NotBoundException
MalformedURLException